Training-Free Consistent Text-to-Image Generation

Yoad Tewel, Omri Kaduri, Rinon Gal, Yoni Kasten, Lior Wolf, Gal Chechik, Yuval Atzmon

TL;DR

ConsiStory is a training-free framework that enables text-to-image (T2I) diffusion models to generate consistent subjects across different prompts without any fine-tuning or optimization. By sharing internal activations and injecting features between images in a batch, it achieves state-of-the-art subject consistency and text alignment while being roughly 20x faster than previous optimization-based methods.

What Problem Does This Paper Address?

Modern T2I models like Stable Diffusion XL (SDXL) are incredibly creative, but they are also inherently stochastic. If you ask for "a photo of an old man in a park" and then "a photo of an old man eating dinner," the model will likely generate two completely different people.

Existing solutions generally fall into two camps:

  1. Optimization-based (e.g., DreamBooth, LoRA): These require fine-tuning the model on a specific subject, which is computationally expensive and slow (taking minutes to hours).
  2. Encoder-based (e.g., IP-Adapter): These use extra neural networks to condition the model on an image, but they often struggle with complex prompts and multi-subject scenes.

The authors identify a core flaw: these methods try to enforce consistency a posteriori (after the fact). ConsiStory instead promotes consistency a priori—during the generation process itself—by allowing different images in a batch to "talk" to each other.

Methods

ConsiStory operates in a zero-shot manner, intervening in the self-attention layers of a pre-trained, frozen diffusion model. Its architecture is built on three main pillars:

  1. Subject-Driven Self-Attention (SDSA): Standard self-attention allows pixels within one image to attend to each other. SDSA extends this so that queries from one image can attend to "subject" keys and values in other images within the same batch. To prevent the backgrounds from merging (background collapse), they use subject masks derived from cross-attention maps to ensure only subject-related features are shared.
  2. Layout Diversity Strategies: Sharing features too aggressively can lead to "mode collapse," where every image has the subject in the exact same pose. To fix this, the authors introduce Vanilla Query Blending (mixing in features from a standard, non-consistent generation pass) and Self-Attention Dropout (randomly blocking some shared attention) to maintain variety in poses and backgrounds.
  3. Feature Injection: To capture fine-grained details (like the specific texture of a dragon's scales), the method uses DIFT (Diffusion Hyperfeatures) to find dense correspondences between images. It then blends the self-attention output features between matching patches across the batch.
The ConsiStory architecture overview, showing how SDSA and Feature Injection are integrated into the U-Net.

Datasets

The authors introduced a new benchmark dataset to evaluate consistency. They used ChatGPT to generate 100 prompt sets, each containing 5 prompts featuring a recurring subject (spanning humans, animals, fantasy creatures, and inanimate objects) in various settings and styles.

For evaluation, they compared ConsiStory against:

  • SDXL (Baseline)
  • Textual Inversion (TI)
  • DreamBooth-LoRA (DB-LoRA)
  • IP-Adapter
  • The Chosen One (a concurrent optimization-based method)

Key Insights and Ideas

  • Consistency is already "in there": The most profound insight is that pre-trained diffusion models already possess the internal representations necessary for consistency. We don't need to teach the model a new subject; we just need to align the stochastic choices it makes across different images.
  • A-Priori Alignment: By sharing activations during denoising, the model naturally converges toward a shared identity. This is far more efficient than generating an image and then trying to force others to match it.
  • Multi-Subject Scalability: Because the method relies on masking, it handles multiple subjects (e.g., a boy and his dog) much better than personalization methods, which often struggle to learn two distinct identities simultaneously.
ConsiStory successfully maintaining two distinct identities (boy and dog) across different scenes.

Key Results

  • Speed: ConsiStory is significantly faster. It takes about 32 seconds to generate a consistent set on an H100 GPU, compared to ~13 minutes for the previous state-of-the-art (a 25x speedup) and 4-7 minutes for LoRA/TI.
  • Pareto-Front Performance: In quantitative tests using CLIP (for text alignment) and DreamSim (for subject consistency), ConsiStory outperformed or matched all baselines, finding the best balance between following the prompt and keeping the character the same.
  • User Preference: In a large-scale user study (3,000 responses), users preferred ConsiStory over baselines for both visual consistency and textual alignment.
Qualitative comparison showing ConsiStory maintaining identity and prompt adherence better than IP-Adapter, TI, and DB-LoRA.

Limitations and Future Work

  • Style Entanglement: The method currently struggles to separate a subject's appearance from the artistic style of the image. It works best when all images in a set share the same style.
  • Localization Dependency: The quality of the subject masks depends on the model's internal cross-attention. If the model fails to localize the subject correctly in the early steps, consistency will suffer.
  • Model Bias: Like the underlying SDXL model, ConsiStory can inherit ethnic or gender biases unless specific modifiers are added to the prompts.

Future work could involve extending this to video generation or developing better ways to disentangle subject identity from environmental style.

Summary updated

BibTeX
@article{tewel2024training,
  author = {Yoad Tewel and Omri Kaduri and Rinon Gal and Yoni Kasten and Lior Wolf and Gal Chechik and Yuval Atzmon},
  title = {{Training-Free Consistent Text-to-Image Generation}},
  journal = {ACM Trans. Graphics},
  year = {2024},
  doi = {10.1145/3658157},
}
Figure