Introduction
Recent advancements in text-to-image (T2I) generation, exemplified by models such as SDXL and DALL-E 3, have achieved remarkable levels of visual fidelity. However, these models frequently struggle with complex compositional prompts. Common failure modes include "attribute leakage"—where properties like color or texture bleed between distinct objects—and a general inability to adhere to precise spatial or numerical constraints. For instance, a request for "a red apple on the left and a blue pear on the right" may result in two red fruits or misplaced objects.
These challenges stem from the inherent difficulty diffusion models face in representing multiple entities with distinct attributes and specific spatial relationships within a single denoising process. To address this, we present Recaption, Plan and Generate (RPG), a training-free framework that leverages the reasoning capabilities of Multimodal Large Language Models (MLLMs) to act as global architects for the diffusion process.
The RPG Framework
RPG decomposes the image generation process into three distinct stages, utilizing the MLLM for high-level planning and the diffusion model for execution.
1. Multimodal Recaptioning
Standard user prompts are often brief and lack the descriptive density required for high-fidelity generation. RPG utilizes an MLLM (e.g., GPT-4) to expand these prompts into detailed sub-prompts. This process provides the diffusion backbone with fine-grained information regarding textures, shapes, and lighting for each specific entity in the scene.
2. Chain-of-Thought (CoT) Planning
To solve spatial reasoning issues, the MLLM performs CoT planning to divide the image canvas into a grid of complementary sub-regions. The model generates a specific split ratio (e.g., a 2x2 grid) and assigns the previously generated sub-prompts to specific coordinates. This offloads the structural logic from the diffusion model's cross-attention layers to the LLM's superior spatial reasoning capabilities.
3. Complementary Regional Diffusion (CRD)
The CRD module is the technical engine that synthesizes the planned regions. During denoising, the framework generates latents for each sub-region in parallel. To prevent the "collage effect"—where the final image looks like disjointed pieces—RPG blends these regional latents with a "base prompt" latent representing the entire scene. By applying a weighting factor ($\beta$), the framework ensures that while each region remains distinct, the final output maintains global coherence in lighting, perspective, and style.
Closed-Loop Editing
Beyond initial generation, RPG supports a closed-loop system for image refinement. The MLLM can inspect a generated image, identify discrepancies relative to the original prompt (e.g., a missing object or incorrect color), and plan a local "mask-and-inpainting" operation to rectify the error without regenerating the entire image.
Experimental Results
RPG was evaluated primarily on T2I-CompBench, a benchmark specifically designed to test attribute binding, object relationships, and complex compositions.
Performance Metrics
RPG demonstrated significant improvements over state-of-the-art models including SDXL and DALL-E 3:
- Attribute Binding: In color binding tests, RPG achieved a score of 0.8335, vastly outperforming DALL-E 3 (0.5750) and SDXL (0.6369).
- Numerical Accuracy: RPG showed a superior ability to generate the exact count of requested objects (e.g., "eight patterned mugs"), a task where standard models often produce inconsistent results.
- Spatial Reasoning: By utilizing explicit grid planning, RPG accurately placed objects according to complex spatial instructions that typically confuse standard diffusion models.
Discussion and Limitations
One of the primary advantages of RPG is its training-free modularity. It can be integrated with various MLLMs (GPT-4, Llama 2) and diffusion backbones (SDXL, ControlNet) without any fine-tuning. However, this modularity comes with increased inference latency due to the requirement of an LLM call and parallel latent generation. Furthermore, the current reliance on rectangular grid splits may limit the framework's effectiveness for highly organic or diagonal compositions that do not conform to a grid structure.
Conclusion
RPG represents a significant step toward controllable text-to-image synthesis. By treating the MLLM as a spatial architect and the diffusion model as a regional painter, the framework effectively bypasses the compositional weaknesses of current generative models, setting a new standard for prompt adherence and complex scene generation.
Summary updated