Planning and Rendering Practices for Complex Instruction-Based Image Generation
Image generation from complex instructions often fails due to logical inconsistencies rather than aesthetic flaws. This article explores a pipeline approach—planning, rendering, and verification—to address challenges like attribute binding, spatial relations, negations, and text rendering. By separating scene planning from pixel rendering and implementing structured prompts and rigorous quality checks, developers can transition from relying on random sampling to achieving reproducible, high-fidelity image generation workflows.
The challenge in complex instruction-based image generation usually lies not in visual appeal but in condition adherence. A single prompt might simultaneously include subjects, attributes, relative positions, quantities, negations, and readable text. If the generation process merely samples words as visual textures, models often assign colors to the wrong objects, misinterpret “exclude” as “include,” or render illegible letterforms. To consistently produce usable images, generation must be treated as an auditable pipeline: compile language conditions into a scene plan, render pixels according to the plan, and verify the output using rule-based checks.
1. Where Failures Come From
Diffusion models excel at gradually forming lighting, textures, and compositional styles from noise but lack inherent discrete logic maintenance. Spatial words (left, right, above, between), quantifiers, and negations are often weak signals in the training distribution. The model may have seen many “red objects” and “dogs” but rarely enforces that “red applies only to the raincoat, and the dog is separated from the apple.” Consequently, high-probability textures override low-probability constraints, leading to attribute bleeding, relation reversal, and extraneous objects.
Text issues share the same root cause. If characters are treated as local textures, the model aims for “looks like text” rather than “is this exact text.” The structural components of Latin letters or Chinese characters require symbol-level constraints; otherwise, requirements for posters, UI screenshots, or signage can only be fulfilled through manual post-processing.
2. Plan First, Render Later
A widely discussed hybrid approach is to separate “understanding and layout” from “pixel rendering,” rather than expecting a single sampling pass to handle both correctly.
The planning stage resembles a language model’s sequential decision-making: read the instruction and output a structured scene description. It defines the object list, attribute bindings for each object, relative positions, excluded elements, and text content, language, and general area. The rendering stage then generates the image based on this description, focusing on lighting, style, clarity, and overall aesthetics.
The value of this split lies in visible intermediate results. If the plan is wrong, you can revise the plan instead of attributing all failures to “rerolling.” It also makes negative conditions explicit prohibitions rather than buried natural language left to chance.
A conceptual scene plan can be expressed using standard structured text. It is not a specific vendor’s API, but an intermediate format easily inspected by both humans and programs:
scene:objects:- id: personattrs: [red_raincoat]region: left- id: animalattrs: [dog]region: rightforbid: [holding_apple, eating_apple]- id: seatattrs: [blue]region: background_centertext:- content: "Happy Mid-Autumn Festival"region: top_bannermust_be_legible: truechecks:- color_binding: red only on raincoat- relation: person left_of animal- negation: no apple adjacent to animal
The planner does not need to “invent” capabilities that do not exist; it simply clarifies the constraints stated by the user. If the renderer cannot stably meet a specific condition, it should be flagged as a failure during quality inspection rather than silently rewriting the requirement.
3. Separate Attributes, Spatial Relations, and Negations
From an engineering perspective, it is recommended to convert a single copy prompt into four types of slots to reduce the model’s tendency to merge concepts.
- Entity slot: What objects exist, each with a unique identifier. Avoid writing “red raincoat girl” and “red dog” as loose bag-of-words models that might share the “red” attribute.
- Binding slot: Colors, clothing, and materials must be bound to entity IDs with explicit “no transfer to other entities” rules.
- Relation slot: Use a few strict spatial relations (left/right, top/bottom, front/back, containment, separation) instead of literary metaphors. For precise composition, specify rough regions (e.g., left third, top banner) rather than just saying “next to.”
- Negation slot: List prohibitions separately. Negation is the most fragile aspect in generation and should appear in both the plan and the QA checks (e.g., “No apples in the scene, dog’s mouth must not touch food”).
Quantities must also be explicit. If only one dog is needed, set the quantity to 1 and exclude a second animal in the checks; otherwise, background textures often morph into extra creatures.
4. Treat Text as Symbols, Not Patterns
Readable text should be a separate layer: content, font style tendency (serif or sans-serif is sufficient; no need to specify non-existent proprietary font packages), approximate position, and contrast requirements. Post-generation, verify character by character rather than just checking for “strokes.”
In practice, a three-tier strategy can be adopted:
- Tier 1: Short text, high contrast, large font, simple background—let the generation model output text directly. Suitable for titles.
- Tier 2: Complex paragraphs, small fonts, multilingual mixing—leave blank information zones during generation and overlay text using typography tools to ensure character accuracy.
- Tier 3: Text fused with lighting (neon, engraving, fabric print)—ensure the text mask is correct before stylization to avoid guessing letters after styling.
Both Chinese and English text should be verified by “string equality,” not by “looks like text.” Case, punctuation, and spacing errors count. If business allows post-compositing, prioritize it: correctness usually beats “generating everything in one pass.”
5. What to Look for in Model Upgrades
If model generation updates market “smarter, more beautiful,” implementation should still return to measurable metrics. Common dimensions for improvement related to images and complex instructions include:
- Instruction adherence: Whether the proportion of simultaneous constraints being met increases, rather than just subjective aesthetics.
- Attribute binding: Whether colors, quantities, or clothing bleed to the wrong objects.
- Spatial relations: Whether left/right, front/back, containment are stable, even when phrased differently.
- Negation and exclusion: Whether prohibited items are still rendered.
- Text fidelity: Character error rate, missing characters, and incorrect order for specified strings.
- Consistency: Whether multiple samples under the same plan cause key logic to jitter. Only style jitter is allowed; relation jitter is not.
- Editability: Whether it is easy to modify only local elements (changing the background or one copy line) without disrupting the correct layout.
These dimensions can be regression-tested using a fixed prompt set without relying on undisclosed benchmarks. Pre-write pass/acceptable deviation/fail rules for each prompt. Failures should map to plan errors, render errors, or text layer errors to determine whether to adjust prompts, modify the compositing workflow, or switch models. Subjective “beautification” can be scored separately but should not replace the logic pass rate. In poster scenarios, one wrong character makes the image unusable; in character scenarios, an extra hand or reversed relation does the same. Separate aesthetic scores from logic scores to judge if upgrades truly reduce rework.
6. Recommended Production Workflow
- Requirement freezing: List hard conditions and flexible style words. Strong style words often overpower logical signals and should be placed later in the prompt.
- Compile plan: Manually or via an assistant, generate the scene plan and confirm with stakeholders to avoid discovering comprehension deviations during generation.
- Render and sample: Perform small batch sampling under the same plan instead of unconstrained mass rerolling. Record random seeds and plan versions for each sample.
- Automated and manual QA: Automate what can be rule-based (e.g., OCR for text, mask sampling for simple color regions). Relations and negations still require manual inspection, but checking against a checklist speeds this up significantly.
- Layered rework: Fix the plan for logic errors; re-render only for lighting or style issues; replace the text layer for text errors. Avoid regenerating the entire image.
- Archive: Save the plan, final image, and failure reasons. Use the same plan set for regression testing during the next model upgrade to see if adherence rates actually improved.
If the result is intended for slides or design drafts, a more robust approach is to let the image handle the visual while the layout file handles title hierarchy and editable text. This exports a modifiable document rather than a static bitmap that cannot be text-edited. Object storage can save plans and final images, while logs and monitoring track failure types—all standard engineering practices independent of any specific product’s proprietary workflow.
7. Existing Limitations
Planning before rendering does not guarantee physical plausibility or perfect perspective, nor can it conjure rare combinations absent from the training data. Fine fingers, complex occlusions, and mirror reflections may still fail. If the plan is overly saturated, the renderer will ignore later clauses. Therefore, constraints should be few and hard: lock only the conditions that truly affect the business for each image, leaving the rest to style sampling.
Furthermore, QA standards must match the use case. Social media graphics can tolerate slight relation deviations; infographics, logos, or materials with pricing or promises should aim for zero character errors and zero critical relation errors. Treating “looks okay” as “usable” is a primary source of rework for these tasks.
8. Conclusion
The key to complex image generation is acknowledging that the diffusion process does not handle logical bookkeeping. Compiling instructions into entities, bindings, relations, and negations, rendering, and then verifying against that plan transitions the process from random luck to reproducible production. The advantages of model upgrades should be reflected in the pass rates of these checks, text fidelity, and rework costs; aesthetic improvements are just one aspect and cannot cover up incorrect layouts or misspelled text. By slotting requirements, preserving intermediate plans, and adopting layered rework, developers can achieve true controllability even when using different generations of general-purpose generation models.
