Training a Multimodal Image Generation Model End-to-End on Domestic Chips: Architecture, Prompting, and Cost Control

    This article examines the first SOTA multimodal image generation model trained end-to-end on domestic chips, covering the full pipeline from data preparation to inference. It explains the hybrid autoregressive plus diffusion decoder architecture, summarizes hands-on API testing results for Chinese instruction understanding, multi-region text rendering, and complex diagrams, and outlines practical prompt engineering, API integration, cost control, and production deployment strategies for developers building content products.

    Training a Multimodal Image Generation Model End-to-End on Domestic Chips: A Practical Guide

    Why This Matters

    The most notable shift in multimodal image generation recently is not just better image quality and style. It is that “self-reliance and controllability” across training and inference has become an engineering reality. The industry has seen the first SOTA multimodal model complete the entire pipeline on domestic chips, from data preparation and training to inference. This means that even with constrained compute supply and an uncertain external hardware ecosystem, teams can still carry out large-model-level training and iteration on a local compute stack.

    For developers, the significance breaks down into three layers:

    1. Improved compute availability: Teams are no longer fully dependent on a single hardware ecosystem. Domestic compute clusters provide an alternative path for training and fine-tuning.
    2. A reshaped cost structure: The combination of open weights and low-cost APIs can push the cost of generating a single image from the range of a few cents down to around one cent or lower. For batch generation workloads, this is decisive.
    3. Better fit for Chinese-language scenarios: Chinese instruction understanding and Chinese text rendering are natural strengths of domestic models. When producing Chinese posters, infographics, and educational illustrations, the cost of trial and error drops significantly.

    I was recently looking for cost-effective image generation for a content product and compared several relay services. Most forced a repeated trade-off between stability and price. Once the per-image cost entered the one-cent range, the unit economics of the whole business had to be recalculated. The rest of this article covers architecture, hands-on testing, prompt engineering, API integration, and production engineering.

    Technical Architecture: A Hybrid of Autoregression and a Diffusion Decoder

    This new generation of models generally adopts a hybrid architecture of “autoregression plus a diffusion decoder.” The core idea is to split image generation into two stages:

    • Autoregressive stage: Following the approach of language models, the image is discretized into a token sequence and predicted token by token, which naturally supports joint modeling with text. A common approach is to introduce a large autoregressive backbone (for example, around 9B parameters) responsible for “semantic planning.”
    • Diffusion decoding stage: A DiT (Diffusion Transformer) style decoder (for example, around 7B parameters) restores the discrete tokens into continuous pixels, handling “detail rendering.”

    This division of labor brings several engineering benefits:

    Dimension Pure diffusion Autoregressive + diffusion decoder hybrid
    Joint text-image modeling Relies on an extra alignment module Native unified token space
    Long text / multi-region text Prone to blurring and misalignment More stable structured generation
    Complex logic diagrams Structure breaks easily Stronger semantic planning
    Inference pipeline complexity Relatively simple Two stages, requires scheduling optimization

    It is worth emphasizing that this is the first open-source, industrial-grade discrete autoregressive image generation model, and it reaches open-source SOTA on authoritative text rendering leaderboards. For teams working on design and educational content, “text rendering” is often more critical than “good-looking style,” because it directly determines whether the output is usable.

    Hands-On Findings: Where the Capability Boundaries Lie

    I ran a round of internal testing through the API. The conclusions can be summarized as three strengths and one weakness.

    1. Strong Chinese instruction understanding and high accuracy for multi-region text generation

    This was the most surprising part. Traditional models often produce garbled characters, wrong characters, and position drift with long Chinese sentences and multi-block layouts (for example, a title, body text, captions, and data labels in one image). In testing, the accuracy of multi-region text generation was clearly higher, making it suitable for directly producing usable infographic drafts.

    2. Good performance on complex logic diagrams and educational illustrations

    For diagrams containing arrows, flows, and hierarchical relationships, the model maintains structural consistency well. Example prompt:

    1. A scientific infographic illustration in blackboard chalk style, horizontal composition,
    2. dark blackboard background with visible chalk dust, eraser marks, and grainy texture,
    3. overall resembling the teaching blackboards common in upper-elementary or middle-school
    4. science classrooms; the scene includes a photosynthesis flowchart labeled "light reaction,"
    5. "dark reaction," and "chloroplast," with clear text and neat layout.

    3. Some design and aesthetic capability

    Composition, whitespace, and color schemes generally follow design conventions and can be used directly as a design draft, reducing rounds of manual rework.

    4. Weakness: limited capability under long prompts

    When the prompt is very long (common in content products, often thousands of characters), the model’s adherence to detail declines and it “loses track of some things while attending to others.” This suggests that engineering should proactively compress and structure prompts rather than simply piling on words.

    Prompt Engineering: Making Long Prompts Controllable

    To address long-prompt degradation, a “structured and layered” approach is recommended:

    1. [Style] Flat illustration, low-saturation color palette
    2. [Composition] Horizontal 16:9, center symmetry
    3. [Subject] A server rack
    4. [Text] Title "Domestic Compute," subtitle "Unified Training and Inference"
    5. [Constraints] No text errors, no overlap, 8% edge margin

    Three supporting practices:

    1. Layered priority: Style < composition < subject < text accuracy. When conflicts arise, prioritize text.
    2. Length budget: Keep prompts within the model’s effective window. Split long content into multiple generations and then composite them.
    3. Fixed templates plus variable injection: On the product side, use templates to manage style and only replace business variables, ensuring consistent output.

    API Calls and Cost Control

    General call flow (pseudocode; refer to the actual documentation for interface names):

    1. import requests
    2. resp = requests.post(
    3. IMAGE_API_ENDPOINT,
    4. headers={"Authorization": f"Bearer {API_KEY}"},
    5. json={
    6. "model": "text-to-image",
    7. "prompt": prompt,
    8. "size": "1024x1024",
    9. "n": 1
    10. },
    11. timeout=60
    12. )
    13. resp.raise_for_status()
    14. image_url = resp.json()["data"][0]["url"]

    Four levers for cost control:

    • Cache first: Identical prompt plus identical parameters hit the cache directly, with a hit rate typically above 30%.
    • Resolution tiers: Use low resolution for previews and render high definition only for final output, avoiding wasted compute.
    • Batching and queues: Use a message queue to smooth peaks, combined with elastic scaling on a container platform.
    • Observability: Integrate logging and monitoring with alerts, and build dashboards by prompt length, failure rate, and per-image cost.

    Production Engineering Recommendations

    1. Abstract a unified image generation gateway: Hide differences between underlying models to make future switching easier and avoid vendor lock-in.
    2. Failure fallback: When the primary path times out, automatically switch to a backup model or return a template image to keep the business available.
    3. Content safety: Validate in both directions before and after generation. Run both images and text through moderation, store them in object storage, and retain traceability information.
    4. Evaluation set: Build a regression set of 100 to 200 real business prompts and run it every time you switch models, letting data speak rather than intuition.

    Conclusion

    A SOTA multimodal model trained end-to-end on domestic chips marks more than a technical validation. It signals that the entire chain, from compute and frameworks to models, APIs, and applications, is beginning to offer end-to-end options. The practical benefits for developers are direct: better support for Chinese-language scenarios, more reliable text rendering, and a per-image cost that enters a scalable range. The real engineering challenge has shifted from “can it generate” to “how to generate in batches stably, cheaply, and controllably,” and the answer lies in structured prompts, caching and fallback strategies, and observable cost governance.