Large Language Model Image Generation: How to Define “Generating Images”
This article explains why debates about whether a large language model can “generate images” are usually definition problems rather than model problems. It distinguishes direct image generation, indirect generation through SVG, HTML Canvas, or custom drawing instructions, and editing-based generation. It also examines rendering pipelines, output protocols, distribution channels, and product architecture, showing why user experience alone is not a reliable capability statement. The article proposes a four-level definition of image generation, evaluation metrics, testing methods, and engineering safeguards to make capability claims verifiable.
1. The core dispute is about definitions, not models
These debates often begin with a simple exchange. A reviewer says that a model can generate images. When others question the claim, the reviewer cites the model’s own answer as support. The two sides then adopt different standards, and the discussion becomes circular.
If we set aside the specific people and examples, the disagreement can be abstracted into a more important point: the two sides are not discussing the same layer.
- Skeptics usually mean a text-to-image model: given a short description, the model produces an image that did not exist before.
- Supporters usually refer to a user experience: a user asks, “Help me draw a picture,” and an image quickly appears in the chat interface, ready to be opened and saved.
The first is a capability-implementation perspective. The second is a capability-experience perspective. The mismatch exists because the statement “the model can generate images” often omits three key details: how the image is generated, through which rendering pipeline it is presented, and through which distribution channel it reaches the user.
Once those three details are filled in, most disagreements can be classified. This article does not judge specific models or specific people. Instead, it offers an engineering framework: first align on definitions, then discuss capabilities, and finally resolve the issue with verifiable tests.
2. The first layer: from “can draw” to “delivered image”
2.1 Three definitions of “generating images”
Based on common implementation patterns, “image generation” can be roughly divided into three types:
- Direct generation: the model directly produces pixel data from a text description. The output is an image, for example when calling a dedicated image-generation model.
- Indirect generation: the model outputs structured drawing descriptions or drawing code, which is then converted into an image by a rendering step.
- Edit-based generation: the model modifies, crops, composites, or extracts elements from existing images through tool functions, producing a new image.
To determine which category a capability belongs to, the key question is: what is the model’s raw output? Is it pixels, code, or a tool call?
2.2 Output protocols determine what can be generated
Currently, common output protocols for graphics fall into three categories:
- SVG, or Scalable Vector Graphics: an XML-based vector description. Images are composed from primitives such as rectangles, circles, paths, and text, with additional capabilities provided by mechanisms such as
textPath,linearGradient, andfilter. - HTML + Canvas: HTML builds the page structure, while the Canvas JavaScript drawing API renders bitmap content. This is suitable for charts, diagrams, and scenarios that require dynamically computed results.
- Custom instruction sets: the model outputs a custom structured instruction set, which the application layer parses and maps to SVG or Canvas calls.
The following code is illustrative only and does not refer to any specific product:
<!-- SVG snippet produced by the model: a vector graphic described as text --><svg width="320" height="180" viewBox="0 0 320 180"><rect x="1" y="1" width="318" height="178" rx="10" fill="#EEF3FF" stroke="#4A78D0"/><circle cx="90" cy="80" r="28" fill="#4A78D0"/><text x="136" y="88" font-size="18" fill="#1F2D3D">SVG vector diagram</text></svg>
// The model produces a drawing description; the Canvas code renders it to the canvas.function drawBadge(canvas, label) {const ctx = canvas.getContext('2d');ctx.fillStyle = '#4A78D0';ctx.roundRect(10, 10, 200, 60, 8); // Rounded rectangular backgroundctx.fill();ctx.fillStyle = '#FFFFFF';ctx.font = '16px sans-serif';ctx.fillText(label, 24, 46);}
Regardless of which protocol is used, the model itself only produces text. The image becomes visible to the user only after rendering. It becomes an image file with a file extension only after export.
2.3 Rendering pipeline: from model output to what users see
A typical rendering pipeline is as follows:
User request│▼Language model generates a drawing description(SVG / front-end drawing code / tool-call arguments)│▼Rendering engine interprets and executes├─ In-browser rendering: HTML, SVG, and Canvas are parsed and drawn by the front-end runtime└─ Server-side rendering: a headless browser loads the page and takes a screenshot,or a server-side vector graphics library performs format conversion│▼Optional export to bitmap → persistence in object storage →return a file URL or embedded display in the page
In this pipeline, the language model is responsible only for describing what to draw and how to organize the image. The rendering engine is what actually draws the picture. The two modes have different emphases:
- In-browser rendering: browsers and mobile WebViews naturally support HTML, SVG, and Canvas. There is no need to introduce a separate image-generation service. The front end can insert markup into the page to display it, and can also call a canvas export API to obtain a bitmap.
- Server-side rendering: a headless browser can load the page and take a screenshot, or a server-side vector graphics library can complete format conversion. This produces an image file that remains accessible even outside a browser.
From the user’s perspective, the input is a prompt and the output is an image. From the system’s perspective, this is a combination of “language model + rendering pipeline.”
The capability boundaries of these two paths are different. In general:
- Good at: flowcharts, architecture diagrams, schematic diagrams, data charts, information cards, poster layouts, simple icons, and interface diagrams with precise text.
- Not good at: photorealistic photos, complex lighting and shadows, detailed illustrations, and realistic people. These kinds of images exceed what primitive composition can express.
There is another often-overlooked implicit assumption: the size, colors, and text rendering of the canvas depend on the fonts, browser engine, and version on the user’s device. The same drawing code may produce misaligned glyphs, shifted lines, or different rounded corners in different environments.
2.4 Distribution method: whether it becomes a product capability
Just as important as the implementation path is the distribution method: does the model itself “draw,” or does the product that hosts it “present” the result?
- Isolated capability: the model can output SVG text, but the chat product only renders plain text. Users see code, and the experience is “it cannot generate images.”
- Reachable capability: the markup produced by the model is parsed and rendered into graphics by the product. Users immediately see an image, and the experience is “it can generate images.”
If the model is exposed as a tool call to an agent, the pipeline becomes even more complete: the language model decides which drawing tool to call and what arguments to pass; the tool service handles rendering and export; and the agent platform handles orchestration, permissions, and returning results. Together, these components form a coordinated system rather than an isolated capability of a single model.
2.5 Redefining “image generation”: a four-level model
Based on the analysis above, “image generation” can be divided into four levels according to how directly the model outputs an image:
| Level | Typical implementation | Raw model output | Extra rendering/export needed? | Typical scenarios |
|---|---|---|---|---|
| L1 Direct generation | Calls a dedicated image-generation model | Image data, such as pixels | Usually no | Photorealistic images, illustrations, concept art |
| L2 Indirect generation | The model outputs SVG, drawing code, or a drawing description | Text or code | Rendering is required; export to bitmap may be needed | Flowcharts, charts, infographics, icons |
| L3 Edit-based generation | The model calls editing tools | Tool-call arguments | Processing is completed by the tools | Photo editing, background removal, local redrawing |
| L4 Text-only description | The model only provides drawing ideas or prompts | Plain natural language | No image is produced | Creative ideation, prompt writing |
L1, L2, and L3 are all valid and reasonable image-generation approaches in their respective scenarios. The difference is who directly produces the image. The two sides in a debate may be referring to different levels when they say “it can generate images.” If the level is clearly labeled, many disputes become unnecessary.
3. The second layer: why user experience is not a capability inventory
“Users can see an image, so the model can generate images.” This reasoning works at the product-experience level, but it is not sufficient for a precise capability description. There are at least three gaps.
Gap 1: The capability source is misattributed.
The image a user sees may come from the language model’s drawing description, or it may come from a rendering engine or image-generation service. If the capability of a rendering service is credited to the language model, the model’s own capability may be overestimated. If the model or pipeline is later changed, the capability may appear to “disappear” inexplicably.
Gap 2: The boundary is blurred.
“It can generate a simple flowchart” and “it can generate a realistic image of a person” are tasks of completely different difficulty. Summarizing both as “it can generate images” may create wrong expectations about output quality. A single complaint such as “it does not look right” may turn into a trust issue.
Gap 3: It is easy to overgeneralize.
A single success does not mean stable usability. As the number of elements in the example code increases, the model may miss closing tags, produce out-of-bounds coordinates, get the layer order wrong, or make mistakes with complex features such as gradients, paths, and filters. Stable success rates should be evaluated under conditions such as concurrency, different prompt styles, and multi-turn follow-ups.
Why a unified entry point is reasonable: multi-component coordination is normal
Some may argue that emphasizing the rendering step focuses too much on implementation details. In fact, delegating image generation to multiple coordinated components is a very common engineering practice.
This is similar to a website technology stack. Pages are rendered in the browser by HTML, CSS, and JavaScript. The server side is supported by application frameworks, databases, caches, search services, message queues, and other components. Users remember a URL and a brand, and do not need to distinguish which service was called behind the scenes.
Likewise, in conversational products, users care about “Can I get the image I want here?” not about whether the backend uses a standalone image-generation service, front-end drawing capabilities, or a third-party image tool.
Two important conclusions follow:
The product name and the underlying implementation are naturally layered.
For a conversational product, the product itself is often a routing and orchestration layer. Capabilities such as text chat, speech recognition, speech synthesis, web retrieval, and image generation may be provided by different models or different services, and then presented under a unified chat interface. This is a common architecture for mature products. Similarly, agent platforms and AI-native application development platforms commonly support orchestrating language models with tools such as image generation, retrieval, and code execution under a single entry point. Baidu AI Cloud’s Qianfan, for example, is a model and AI-native application development service platform. Going further down, cloud GPU resources are also shared by many upper-layer models. It is already common for the same accelerator card to serve different model services.But this cannot justify vague capability statements.
A layered architecture explains why “it can generate images from the user’s perspective” is reasonable, but it does not mean that capability declarations can be omitted. Precisely because multiple components are coordinated, developers need to clarify the capabilities and boundaries of each layer.
4. The third layer: why an AI’s own answer is not evidence
Another focus of the dispute is whether it is valid to use the model’s own answer to rebut skeptics.
First, the reasonable part. If the model answers, “I can draw a flowchart,” it can directly resolve some misunderstandings. For example, a user who only sees a chat box may think that only text is possible, or may treat SVG code as an error message. In this case, a demonstration is better than ten explanations.
Second, the limitation, which is more important. In disputes involving definitions and boundaries, such as “Does this count as image generation?”, the model’s self-description is only reference information. It cannot serve as decisive evidence. There are three reasons:
There is no verifiable process.
The answer text itself does not contain information about whether the drawing description was generated, whether rendering succeeded, or what the final file looks like. Screenshots and screen recordings can prove that “it succeeded this time,” but they cannot prove that “it will succeed in every case.”Self-assessment bias exists.
A model’s understanding of its own toolchain comes from prompts, system settings, and training data, which may not fully match the actual online configuration. After a pipeline change, the model may still answer according to an old description. When facing leading questions, it may also give agreeable answers.Definition questions must be decided by humans.
“If the model outputs SVG and the interface renders it into an image, does that count as the model generating an image?” This is a question of terminology. The model cannot decide how people should use the term “image generation.”
A clear principle is: the model’s responsibility is to produce content, while evidence must come from the system.
/*** Unified drawing capability entry:* parameter validation → model output → server-side rendering → object storage* Users eventually receive an accessible image URL, which serves as the evidence.*/async function renderToImage({ prompt, width, height }) {// 1. Validate inputs: limit canvas size to avoid rendering timeouts or memory overflowif (width * height > MAX_CANVAS_PIXELS) {throw new RangeError('canvas size exceeds limit');}// 2. The language model outputs SVG in the agreed format.// In real projects, JSON is often preferable for parsing and validation.const svg = await languageModel.complete({ prompt, outputFormat: 'svg' });// 3. Security validation: remove scripts, event-handler attributes,// external references, and other dangerous content (see Section 6).const safeSvg = sanitizeSvg(svg);// 4. Render to PNG on the server.// When displaying on the client, this step can be skipped and SVG can be used directly.const pngBuffer = await renderSvgToPng(safeSvg, { width, height });// 5. Persist to object storage and return an accessible image URL.const objectKey = await objectStorage.put(pngBuffer);return { imageUrl: objectKey, mimeType: 'image/png', width, height };}
This example describes a general reference pipeline: validate inputs first, let the model generate content, then perform security filtering, rendering, and persistence, and finally return a real resource URL.
Returning to the original debate: instead of repeatedly asking the model whether it can generate images, try a prompt such as “Draw a three-step flowchart” and see whether the response is an image, a piece of code, or an apology. The result is provided by the system. It is reproducible and verifiable, and the dispute naturally converges.
5. Making “image generation” verifiable: evaluation methods
To objectively evaluate a system with image-generation capabilities, measurable indicators should be established across three dimensions: functionality, quality, and engineering.
5.1 Functional usability
- Success rate: the proportion of requests that return a valid image.
- Decodability rate: whether the returned image can be decoded and displayed normally, rather than being a corrupted file or a blank image.
- Constraint satisfaction rate: whether specified text is included, whether quantitative relationships are correct, and whether the color scheme meets requirements.
- Cross-device consistency: whether the same request renders consistently on desktop and mobile.
5.2 Output quality
- Text-image alignment: use a general text-image similarity model for automatic scoring, combined with human review. Such models are trained on large-scale image-text pairs from the internet and can provide reference scores for semantic consistency between the image and its description.
- Structural correctness: whether the layout is aligned, whether elements overlap or exceed boundaries, and whether the reading order is reasonable.
- Readability: whether font sizes are too small and whether text contrast is sufficient.
- Editability: whether the source file can be modified and re-rendered. This is a core advantage of vector approaches over bitmap approaches.
- Human scoring: reviewers can rate results as “directly usable,” “usable after minor adjustments,” or “not usable.”
5.3 Engineering metrics
- Time to first byte and end-to-end latency;
- Rendering failure rate and timeout rate;
- Resource usage for large-size requests;
- Stability under high concurrency.
5.4 Test set design
The test set should cover simple primitives, complex layouts, mixed Chinese and English text, very long text, special characters, and other dimensions. The following code is illustrative:
// Illustrative structure for image-generation test cases.// Fields can be extended according to business needs.const testCases = [{id: 'flowchart-basic',category: 'Flowchart',prompt: 'Draw a three-step flowchart: submit request → review → complete, arranged from top to bottom',checks: ['contains 3 nodes','arrows point from top to bottom','text is correct and complete']},{id: 'chart-with-numbers',category: 'Data chart',prompt: 'Use a bar chart to show sales for four quarters: 100, 150, 120, 180',checks: ['contains 4 bars','bar heights are proportional to the values','axis labels are complete']},{id: 'poster-long-text',category: 'Information card',prompt: 'Create an event poster containing a title, time, location, and a description of more than 100 characters',checks: ['text does not overflow','layout is aligned','contrast is readable']}];async function runEvaluation(renderToImage, cases) {const results = [];for (const c of cases) {const start = Date.now();try {const { imageUrl } = await renderToImage({prompt: c.prompt,width: 960,height: 540});// In real projects, each check can be executed by an automated validation script// or a review platform.results.push({id: c.id,imageUrl,latencyMs: Date.now() - start,status: 'ok'});} catch (err) {results.push({id: c.id,status: 'failed',reason: err.message});}}// Aggregate results into a pass-rate report as a baseline for version iterations.return results;}
5.5 Multi-turn follow-ups and context stability
When users repeatedly ask, “Change the color to blue” or “Make it larger,” the model may lose canvas parameters or generate markup that cannot be parsed. A structured drawing context should be maintained during the session, constraining the model to modify only the parts that need to change:
{"canvas": { "width": 960, "height": 540 },"theme": { "primary": "#4A78D0", "background": "#EEF3FF" },"elements": [{ "type": "rect", "x": 40, "y": 40, "w": 280, "h": 120 },{ "type": "text", "x": 60, "y": 100, "content": "Quarterly overview" }]}
With this approach, even if the model’s local description is inaccurate, JSON Schema validation can detect the issue and provide a friendly response instead of passing broken code directly to the user.
5.6 Acceptance checklist before and after launch
- Capability statements match actual test conclusions, and clearly state applicable and non-applicable scenarios;
- Failure scenarios have clear fallback strategies: automatically fix what can be fixed, and honestly inform users when it cannot be fixed;
- All security and compliance checks have passed, as described in the next section;
- Documentation and help centers are updated, specifying output formats, supported content types, and typical latency;
- Logging and monitoring are connected, allowing success rates, latency, and error types to be tracked.
6. Risks and boundaries in engineering practice
6.1 Capability boundaries must be explicit
- Environment dependencies: missing fonts, version differences, and mobile WebView limitations may cause the same code to render differently. For images that need long-term storage or cross-device distribution, it is better to fix fonts before rendering, or to complete rendering and export on the server side.
- Quality limits: for photorealistic or photographic requirements, it is more appropriate to choose an image-generation capability directly. Do not force primitive composition when it cannot meet the requirement.
- Accessibility: provide alternative text for images. Chart colors should have sufficient contrast, and legends or shapes should be used to distinguish information. Do not rely only on color to convey meaning.
6.2 Security risks cannot be ignored
Directly rendering and displaying model-generated markup to users creates real security risks. For example, SVG can embed scripts or event attributes, or include HTML inside <foreignObject>. If the drawing prompt comes from user input, it may also be used to induce the model into outputting malicious content. At a minimum, engineering should include:
- Sanitization: remove scripts, event-handler attributes, and external resource references;
- Limits: control canvas size, the number of elements, and the length of a single text segment;
- Isolation: execute server-side rendering in an isolated runtime environment.
6.3 Review of rendering results
The following code is illustrative:
/*** Run a content safety check on the rendered image* and set a reasonable cache lifetime.*/async function deliverImage(pngBuffer, userInput) {// Image moderation: detect prohibited content and block it.await imageModeration.check(pngBuffer);const objectKey = await objectStorage.put(pngBuffer, {headers: { 'Cache-Control': 'public, max-age=86400' },metadata: { source: 'llm-illustration' }});return {imageUrl: objectKey,note: 'The image was generated by rendering a drawing description produced by a language model; its content was reviewed for safety.'};}
7. Conclusion
Returning to the original question: can a model “generate images”?
- If the question is “Can users get an image here?”, then as long as the model can produce a drawing description, the rendering pipeline can execute reliably, and the product can return images stably, the answer is “yes.” This is independent of which components are called at the bottom.
- If the question is “Can the model itself directly generate images?”, the answer depends on whether it has image-generation capability. This must be verified item by item. It cannot be judged by intuition, and certainly not by the model’s own self-description.
For developers, three conclusions are especially important:
- Separate the layers: first distinguish “product capability” from “model capability,” then discuss whether the capability exists and how strong it is.
- Use graded descriptions: use the L1–L4 capability levels to describe “image generation” precisely. Do not make vague claims, and do not unnecessarily understate capabilities.
- Let evaluations speak: replace verbal debates with reproducible tests and explicit boundary statements. This is responsible to users and shows the most basic respect for the technology itself.
