Hybrid Architecture for Image Generation on Domestic AI Chips: How It Works

    This article explains why text-to-image models are moving toward hybrid architectures that combine an autoregressive backbone with a diffusion decoder. It breaks down the role of each module, shows how text rendering and arbitrary resolutions are handled, and outlines practical engineering considerations for deployment, evaluation, and cost control. Readers will gain a clear understanding of the division of labor between semantic planning and pixel synthesis, and why this design is easier to adapt to domestic accelerators.

    1. Why Image Generation Is Shifting to Hybrid Architectures

    For the past two years, pure diffusion models have been the de facto standard for text-to-image generation. Their advantages are clear: stable training objectives, high parallelism, and a strong quality ceiling. But the limitations are equally obvious. Diffusion is fundamentally a process of gradually denoising from noise, so its grasp of global semantics is indirect. Control over text, structure, and object counts often depends on additional conditioning techniques.

    A new approach has gradually come into focus: combining the autoregressive modeling capability of language models with the pixel-level decoding capability of diffusion models. The former is good at understanding instructions and planning the overall composition; the latter is good at turning semantics into high-quality pixels. The benefit of this division of labor is not just image quality, but more importantly controllability—especially for text-heavy scenarios such as Chinese posters, infographics, and social media covers with embedded text.

    It is worth emphasizing that this type of design has another engineering advantage that is easy to overlook: the computational characteristics of an autoregressive backbone are highly similar to those of language models, making it easier to complete training and inference adaptation on domestic accelerator cards. This provides a viable path toward a fully self-controlled technology stack.

    2. Architecture Breakdown: Two Modules, Two Responsibilities

    1. Autoregressive Backbone: Semantic Understanding and Global Composition

    The autoregressive part is typically a multimodal backbone on the order of billions of parameters. It takes a text instruction as input (optionally extended with image references) and outputs a sequence of discrete visual tokens. It has three responsibilities:

    • Semantic parsing: breaking an instruction such as “create a spring product poster with a teal primary color and the title in the top-left corner” into executable visual elements;
    • Global planning: deciding subject placement, whitespace ratio, visual focus, and style consistency;
    • Sequence generation: producing visual tokens autoregressively, naturally yielding a hierarchy of “composition first, details later.”

    Because the modeling approach matches that of language models, this part can reuse many mature training and parallelism strategies, and it is easier to run end-to-end training on domestic chips.

    2. Diffusion Decoder: Pixel Reconstruction and Text Rendering

    The autoregressive backbone outputs a low-dimensional discrete representation. Reconstructing an image directly from it would lose texture and sharp edges. A diffusion decoder (commonly a DiT structure) is therefore needed to turn tokens into pixels. Its key enhancement is the text rendering module: a dedicated character encoder injects glyph shapes, strokes, and layout constraints as additional conditions, mitigating issues such as missing characters, merged strokes, and garbled Chinese glyphs.

    The overall forward pass can be expressed in pseudocode:

    1. # 1) Encode text and layout conditions
    2. cond = encode_prompt_and_layout(instruction)
    3. # 2) Autoregressive backbone generates visual tokens (global composition + semantics)
    4. visual_tokens = ar_backbone.generate(cond, top_p=0.9)
    5. # 3) Diffusion decoder reconstructs pixels with glyph conditions injected
    6. glyph_cond = glyph_encoder(instruction.text, layout=cond.layout)
    7. image = dit_decoder.decode(visual_tokens, glyph_cond)
    8. return image # arbitrary non-standard resolution output

    This division of “the former understands, the latter writes correctly” is consistent with the industry approach of introducing language model reasoning into image generation, often referred to as cognitive generation.

    3. Non-Standard Resolutions: An Underrated Practical Capability

    Traditional models only support preset aspect ratios such as 4:3 and 16:9. Users have to crop, pad, and re-layout the image afterward, and text is often damaged during cropping. With an improved tokenizer and positional encoding strategy, the model natively supports arbitrary aspect ratios between 1024×1024 and 2048×2048, such as non-standard sizes like 1240×1600.

    The engineering value shows up in three ways:

    • Ready to use: posters, covers, and product detail images need no secondary cropping;
    • Text safety: the layout is finalized in one pass, avoiding cut-off text;
    • Batch-friendly: the same template can produce assets in multiple sizes in bulk.

    Example call (neutral pseudocode):

    1. result = generate_image(
    2. prompt="Spring product poster, teal primary color, title in top-left",
    3. width=1240, height=1600, # non-standard resolution
    4. steps=30, seed=42
    5. )
    6. result.save("poster.png")

    4. Key Engineering Considerations

    1. Memory and throughput: the autoregressive backbone and the diffusion decoder have different memory usage profiles. Load them in stages and offload on demand; on the inference side, prioritize quantization and operator fusion.
    2. Text quality evaluation: build an automated evaluation set for glyph accuracy and stroke completeness, treating text rendering as a regression metric rather than something unpredictable.
    3. Templated production: structure layout constraints (regions, font size hierarchy, whitespace) and send them along with the prompt, which significantly improves stability.
    4. Cloud deployment: use container platforms for elastic scaling, object storage for hosting assets, and logging and monitoring services to track failure rates and latency percentiles.
    5. Cost control: cache intermediate results for fixed-size scenarios, and use one generation with multiple resizes for multi-size needs to reduce repeated inference.

    5. Conclusion

    The value of a hybrid architecture lies not in stacking parameters, but in decoupling understanding from drawing: the autoregressive backbone ensures instruction following and global composition, the diffusion decoder ensures image quality and text correctness, and non-standard resolutions turn technical advantages directly into business usability. For developers, mastering this division of labor matters more than memorizing a specific model—it determines how you design prompts, how you evaluate quality, and how you reliably integrate generation capabilities into production systems.