How Open-Source Text-to-Image Models Render Chinese Text: Architecture, Prompts, and Selection
Open-source text-to-image models have made notable progress in rendering Chinese text, but they still have clear limitations. This article explains how the components of a hybrid architecture divide responsibilities, provides prompt structures for two scenarios—portrait/landscape and poster/infographic—and covers deployment options, per-image cost calculation, and troubleshooting steps. Readers should reproduce the conclusions on their own tasks before applying them.
1. Why Text Rendering Is Harder Than Image Generation
Ordinary image generation prioritizes overall tone, composition, and texture; minor local deviations usually go unnoticed. Text is different. A Chinese character consists of multiple strokes, densely packed, and readers notice immediately if even one stroke is merged or missing. Alphabet-based languages like English have a small character set, so models can easily learn fixed glyphs. Chinese characters are far more numerous, and the same component may be written differently in different characters, requiring the model to memorize glyphs, structure, and context simultaneously.
Text rendering failures typically fall into three categories: spelling errors (characters or words replaced or dropped), merged or broken strokes, and structural collapse (components misplaced, or left-right structures split apart). Identifying the category first determines whether you should adjust the prompt, switch models, or change the output resolution.
2. What Each Part of the Hybrid Architecture Does
Many newer open-source models adopt a hybrid “autoregressive + diffusion” structure. The two parts have distinct responsibilities.
The autoregressive part is usually based on a large language model or its encoder. It reads the prompt, understands the text content, semantic relationships, and layout requirements, and outputs a set of conditional representations. These representations tell downstream modules which characters to write and where to place them. The tokenizer splits text into units the model can process; it provides character-level or word-level semantic information, but does not store pixel-level stroke shapes.
The diffusion part generates the pixels. Guided by those conditions, it denoises step by step, handling lighting, texture, and color transitions. Whether strokes are crisp and structures are stable depends mainly on the capabilities of visual encoding and diffusion decoding—not just the text side.
In short: the text side decides what to write and where to place it; the image side decides how clearly it is drawn. Both ends must be reliable for text to render correctly.
3. How to Write Prompts
Structured prompts (e.g., JSON format) offer clearly defined fields, making them easy to reuse and modify. However, field names are not standardized—different models may use different keys or ignore some fields. The templates below only illustrate the structure; map fields against your chosen model’s documentation before use.
1. Portrait and Landscape Scenes
{"subject": "A woman in traditional Hanfu holding an oil-paper umbrella","environment": "A Jiangnan water town, light drizzle, small bridges over flowing water","lighting": "Soft natural light, diffused illumination, high contrast","style": "Cinematic quality, 8K resolution, hyperrealism","camera": "85mm lens, f/1.8 aperture, shallow depth of field"}
This template separates subject, environment, lighting, style, and camera settings. Once separated, modifying one item (e.g., changing only the lighting) does not affect other descriptions, making controlled comparisons easier. The effects of lighting and camera parameters vary by model and should be confirmed with side-by-side images.
2. Poster and Infographic Scenes
{"background": "Cyberpunk-style city nightscape, neon lights, purple tones","text_elements": [{"content": "Future Tech","position": "Top center of the image","font_style": "Thin-line metallic glyphs with a slight glow on the edges"},{"content": "2024 Product Launch","position": "Bottom center of the image","font_style": "White sans-serif font, moderate letter spacing"}],"layout": "Centrally symmetric composition, ample whitespace around text areas"}
The key in poster scenarios is the text fields. Specify content, position, and font style for each text element to reduce the room the model has to improvise layout. In practice, text content and position are usually followed more reliably than free-form descriptions, but multiple sampling attempts are still needed. Font descriptions should be specific. Vague terms like “futuristic” are less useful than checkable descriptions such as “thin lines, monospaced glyphs, with a slight glow.”
When writing prompts, follow these rules:
- Mark text content separately, apart from the background description.
- Keep the number of text elements per image small—the more elements, the higher the error rate.
- Change only one variable at a time so you can tell which change produced the effect.
4. API Calls or Local Deployment
Neither path is absolutely better; the choice depends on data sensitivity, call volume, and team capability.
| Dimension | API Calls | Local Deployment |
|---|---|---|
| Initial investment | Low—no GPU required | High—requires purchasing or renting GPUs and setting up an inference environment |
| Data privacy | Images and prompts pass through a third party; review their data terms | Data can stay inside your intranet |
| Operational burden | Platform maintains the model and services | You handle version upgrades, drivers, monitoring, and scaling yourself |
| Cost structure | Pay-per-call or usage-based billing; suits fluctuating demand | Mostly fixed costs; per-image cost may be lower at stable, very high volumes |
| Elasticity | Usually scales on demand | Limited by your own compute capacity |
| Compliance | Confirm data storage regions, log retention periods, and usage licenses | You must meet internal audit requirements yourself |
A good approach is to start with an API for small-scale validation, then evaluate local deployment once business needs are stable, call volume is predictable, and privacy requirements are strict.
5. How to Calculate Per-Image Cost
Before discussing per-image cost, the methodology must be defined. Costs for the same image can vary widely depending on: resolution, sampling steps, number of sampling attempts, GPU model and utilization, electricity price, batch size, and the platform’s billing model (per-call, usage-based, or resource packages).
A usable formula:
Per-image cost = (GPU time per inference × hourly GPU cost + amortized operations and storage) ÷ number of usable images per run
The number of usable images refers to images that pass quality checks and can be used directly—not the total number generated. If it takes three sampling attempts on average to get a text-correct result, the effective cost must be calculated over three attempts.
Figures like “0.08 USD per image” or “0.01 USD per image” often cited in articles usually lack these conditions. Re-measure under your own configuration before comparing with other options.
6. How to Troubleshoot Distorted Text
When text errors occur, check the following in order:
- Is the resolution high enough? When the text area occupies too few pixels, strokes are hard to render clearly. Increase the output resolution or move the text to a more prominent position.
- Do prompt fields conflict? For example, the background description contains additional text, or one area has conflicting position requirements—the model may be unable to satisfy both.
- Is the font description too vague? Descriptions like “a nice font” provide no enforceable constraints; use specific glyph shape, weight, and color instead.
- Is there too much text? Split the content across multiple images or remove secondary text.
- Did you sample only once? Generating several outputs with the same prompt and picking the best is usually faster than repeatedly tweaking the prompt.
- Does the model version support Chinese? Check the language support range stated in the model documentation.
7. Minimal Validation Before Going Live
- Prepare 30–50 real business text samples covering common characters, rare characters, texts of varying lengths, and multiple layouts.
- Record the single-attempt success rate and the success rate after multiple sampling attempts for each sample.
- Manually inspect glyphs, strokes, and spelling—do not rely entirely on automated checks.
- Track average time and cost per acceptable image, then plug them into the formula in Section 5 to compute per-image cost.
- Confirm data storage, log retention, and access permissions on the API platform or local environment.
8. Limitations
Open-source text-to-image models can already handle some poster and illustration scenarios involving Chinese text, but they cannot replace the entire design workflow. Error-intolerant content such as brand fonts, legal statements, and pricing information still requires human proofreading. Evaluate against your own business samples rather than trusting a leaderboard or a single article’s conclusions.
