Multimodal Image Generation on Domestic Chips: A Full-Pipeline Training Practice

    This article examines the practical engineering side of an open-source multimodal image generation model trained end to end on domestic (China-made) AI chips, covering data preparation through training and inference. It breaks down the hybrid architecture that pairs an autoregressive backbone with a diffusion decoder, summarizes observed capability boundaries such as Chinese instruction following, multi-region text rendering, diagram structure, and long-prompt decay, and shows how structured prompt engineering can mitigate that decay. It also outlines a vendor-neutral API integration pattern with idempotency, retries, asset archiving, content safety, and observability, a cost model based on cost per usable image, and a checklist for private deployment on domestic accelerators. The intended takeaway is that reproducible evaluation, prompt engineering, and cost governance matter more than leaderboard rankings.

    1. Why Domestic Compute Plus Open-Source Multimodal Image Generation Matters

    Over the past year, image generation has moved quickly from “can produce an image” to “can follow complex Chinese instructions, render legible text, and draw structurally correct diagrams.” Meanwhile, what enterprises actually need is not a single stunning image, but a balance among cost, stability, and controllability. When an open-source multimodal image generation model completes the full pipeline on domestic chips, from data preparation to training, the significance sits at three levels:

    1. Supply: the training and inference chain is no longer tied to a single class of accelerator, which creates alternative paths for compute supply.
    2. Cost: open weights plus multiple inference providers usually mean more competition, and the cost per image trends downward.
    3. Compliance: obtainable model weights mean enterprises can keep sensitive material inside their own environment for inference, substantially reducing the risk of data leaving their perimeter.

    It is worth stressing that a claim like “the first SOTA multimodal model trained end to end on domestic chips” is a conclusion tied to a specific point in time and a specific evaluation methodology. For engineering selection, a reproducible evaluation method matters far more than a leaderboard position.

    2. Technical Breakdown: A Hybrid of Autoregressive and Diffusion Decoding

    The typical design of this class of model chains discrete autoregressive modeling together with a diffusion decoder:

    • Autoregressive backbone (roughly 9B scale): it discretizes the image into a token sequence and predicts the next token in the same way a language model does. The benefit is that it naturally reuses the scaling experience and training infrastructure of language models, and Chinese semantic understanding is inherited along the way.
    • Diffusion decoder (roughly 7B scale, DiT architecture): it takes the discrete representation produced by the autoregressive backbone and restores it to continuous pixels through a denoising process, compensating for the information loss of discrete tokens in texture and detail.

    This division of labor, “semantic planning plus pixel reconstruction,” yields two direct engineering gains:

    • More stable text rendering: text is planned as structured content in the discrete token space, which reduces the stroke merging and glyph drift common in diffusion models.
    • Stronger image-text consistency: instruction understanding happens on the language model side, so layout constraints across multiple regions and labels are easier to honor.

    The cost is a longer inference chain and higher memory consumption, and the latency from serial decoding in the autoregressive stage cannot be ignored either. So when serving the model, a two-stage pipeline optimization is usually required: control sequence length and batch size in the autoregressive stage, and raise parallelism in the decoding stage.

    3. What Testing Showed: Capability Boundaries Matter More Than Parameter Counts

    In one round of testing aimed at real business use, four relatively stable observations emerged:

    1. Good Chinese instruction understanding. For compound constraints such as “landscape composition, dark background, title in the top-left corner, legend in the bottom-right corner,” placement accuracy is clearly higher than early open-source options.
    2. Usable multi-region text generation. With several labels inside a single frame, the probability of wrong or duplicated characters drops, though post-processing validation of key copy is still advisable.
    3. Reasonable structure in diagrams and educational illustrations. Logical elements such as arrow direction, hierarchy, and module containment show a certain ability to “draw it correctly.”
    4. Decay with long prompts. Once a prompt reaches several hundred words, adherence to constraints in the middle section drops, showing up as missing elements or style drift.

    For the fourth point, engineering does not have to wait for model-side improvements; prompt engineering can mitigate it first. The recommendation is to rewrite a long natural-language description into structured blocks with layered weighting:

    1. [Subject] Chalkboard chalk-style scientific infographic, landscape 16:9
    2. [Background] Dark chalkboard, chalk dust and eraser marks, grainy texture
    3. [Text areas] Top-left: title "Photosynthesis"; center-right: label "Chloroplast"; bottom: three legend items
    4. [Style] Educational illustration, hand-drawn lines, low saturation
    5. [Constraints] Text legible, no watermark, no garbled characters
    6. [Negative] Photorealistic, 3D rendering, complex gradients

    The key point is to front-load and chunk the constraints that must appear, and put what must not appear into the negative block, avoiding semantic dilution caused by long nested sentences.

    4. API Integration: A Vendor-Neutral Engineering Pattern

    Whether you use a public cloud service or self-hosted inference, the call shape is highly similar: submit a task, poll or receive a callback, retrieve the artifact, archive it. The following is illustrative code (pseudocode style, not pointing at any specific interface):

    1. # 1) Build the request: structured prompt + frame size + random seed
    2. payload = {
    3. "prompt": build_prompt(spec), # assembled in blocks, see previous section
    4. "size": "1280x720",
    5. "seed": 20260114, # a fixed seed makes reproduction and regression easier
    6. "n": 1,
    7. "response_format": "url"
    8. }
    9. # 2) Submit the task with a timeout and an idempotency key
    10. resp = client.post("/v1/images/generations",
    11. json=payload,
    12. headers={"Idempotency-Key": trace_id},
    13. timeout=30)
    14. # 3) In async scenarios, poll for the result with exponential backoff
    15. task = resp.json()["id"]
    16. for i in range(6):
    17. r = client.get(f"/v1/tasks/{task}")
    18. if r.json()["status"] in ("succeeded", "failed"):
    19. break
    20. time.sleep(2 ** i * 0.5)
    21. # 4) Archive to storage: copy the artifact to object storage, record prompt and parameters
    22. archive(prompt=payload["prompt"], seed=payload["seed"],
    23. bucket="image-assets", key=f"{trace_id}.png")

    Four details must be covered in engineering:

    • Idempotency and retries: the same business request carries an idempotency key to avoid duplicate billing and duplicate artifacts.
    • Artifact transfer: generated links usually have an expiry, so transfer them to object storage immediately and keep the prompt and seed for reproduction.
    • Content safety:审核 the prompt on the input side and run image compliance checks on the output side, intercepting at both ends.
    • Observability: bring latency, failure rate, and cost per image into monitoring and alerting, tagged by business line.

    5. Cost and Stability: Turning “Cheap” into “Controllable”

    A lower unit price is good news, but total cost is not determined by unit price alone. A workable cost model is:

    1. Cost per usable image = (unit call price × number of calls + retry overhead + storage and bandwidth) / number of usable images that pass manual or automated review

    Here the number of usable images is the core variable. If a path has a low unit price but needs an average of 2.5 retries to produce one usable image, its real cost may exceed that of a path with a higher unit price but a better first-pass rate. Therefore:

    • Build tiered routing: simple images go through the low-cost path, images with heavy text or complex logic go through the high-quality path.
    • Build a regression evaluation set: fix 100–200 real business prompts, run them after every change, and track pass rate and human ratings.
    • Build a fallback strategy: when the primary path crosses a threshold, switch to a backup path automatically so the business is not interrupted.

    6. A Checklist for Private and Domestic Deployment

    If data cannot leave your perimeter, you can deploy on your own compute based on open weights. The evaluation focus includes:

    1. Compute compatibility: confirm how well the inference framework and operator libraries work with domestic accelerators, paying particular attention to attention operators and decoding-stage performance.
    2. Memory and throughput: the autoregressive backbone and the decoder are both resident, so reserve headroom for peak memory and use continuous batching to raise throughput.
    3. Quantization and precision: weight quantization can cut cost significantly, but text rendering is sensitive to precision, so use the evaluation set to verify the regression.
    4. Service shape: low traffic can use a synchronous interface; high traffic is better served by a task queue plus an elastic container platform hosting the decoding stage.
    5. Operational loop: logging and monitoring should cover queue time, the distribution of failure causes, and per-card utilization.

    7. Recommendations

    For most teams, the rational path is to validate in the cloud first, then keep private deployment as a fallback: use a public API to quickly validate prompts and business results, and quantify pass rate and cost per usable image; once scale stabilizes, data turns sensitive, or cost share becomes too high, deploy privately on domestic compute based on open weights to form a primary-and-backup dual path. Image generation is moving from “demo capability” to “production component,” and what really decides success is the invisible infrastructure of an evaluation system, prompt engineering, and cost governance.