Introduction
Modern Text-to-Image (T2I) models, such as Stable Diffusion, have revolutionized digital content creation by generating high-fidelity images from simple natural language descriptions. However, these models often struggle with "prompt compliance"—the ability to faithfully represent all elements of a complex instruction. Common failures include missing objects, incorrect spatial relationships, and garbled text. To address these limitations, researchers at UC San Diego have introduced Factor Graph Diffusion Models (FG-DMs), a modular framework that treats image synthesis as a joint distribution of images and their structural conditions.
The Challenge of Prompt Compliance
Existing approaches to improving prompt compliance generally fall into two categories, both of which have significant drawbacks. Inference-based methods optimize the generation process in real-time to match a prompt, but they are computationally expensive and slow. Conversely, Visual Conditioning Diffusion Models (VC-DMs), like ControlNet, offer precise spatial control but require users to provide manual "scaffolding" (e.g., segmentation masks or depth maps), which is labor-intensive to create.
FG-DMs bridge this gap by enabling the model to autonomously generate its own structural scaffolding based on text. This scaffolding is then verified for accuracy before being used to render the final high-quality image, combining the automation of T2I models with the precision of VC-DMs.
Methodology: The Factor Graph Approach
The core innovation of FG-DMs is the decomposition of the image generation process into a sequence of conditional factors. Instead of modeling only the probability of an image given text $P(\text{image}|\text{text})$, the authors model the joint distribution of the image and several conditioning variables, such as $P(\text{image, segmentation, pose}|\text{text})$.
Modular Decomposition and Architecture
The framework breaks the joint distribution into a chain of factors. For instance, the model might first generate a segmentation map from text, then a pose map from that segmentation, and finally the image from both. This is achieved using a T2I-Adapter-style architecture, which adds these capabilities to pre-trained models without requiring a full retraining of the massive backbone. A shared encoder and decoder ensure that the structural factors align with the base model's latent space.
Sampling-Based Prompt Compliance (SBPC)
A key insight of the paper is that "conditions are cheaper than pixels." Structural maps like segmentation masks have much lower frequency content than natural images and can be generated at lower resolutions with fewer diffusion steps. FG-DMs leverage this by "brainstorming" multiple candidate masks (e.g., 10 variations) and using an automated tool to select the one that best matches the prompt (e.g., the one containing all requested objects). This SBPC method allows the model to achieve high compliance while remaining 4x faster than traditional inference-based optimization.
Attention Distillation
To ensure the model generalizes well to objects not seen in its specific structural training data (like the COCO dataset), the authors use an Attention Distillation Loss. This technique distills the attention maps from a pre-trained Stable Diffusion model into the new factor models. Consequently, if the base model knows what a "rhino" looks like, the FG-DM can generate a segmentation mask for a rhino even if it wasn't in the segmentation training set.
Key Results
FG-DMs demonstrate significant improvements across several metrics:
- Improved Compliance: The model achieved a 15% higher object recall compared to standard Stable Diffusion benchmarks.
- Efficiency: The SBPC method provides a 4x speedup over previous state-of-the-art compliance methods like Attend-and-Excite.
- Explainability and Editing: Because the model generates intermediate maps, the process is transparent. Users can inspect the generated segmentation map and manually edit it—such as moving a person or adding a sketch—before the final render, allowing for intuitive, fine-grained control.
Conclusion
Factor Graph Diffusion Models represent a significant step forward in making T2I models more reliable and controllable. By treating structural conditions as first-class citizens in the generation pipeline, FG-DMs provide a scalable, efficient, and explainable framework for high-fidelity image synthesis. Future work aims to extend this modular approach to more complex domains, including video and 3D generation.
Summary updated