Training-Free Consistent Text-to-Image Generation

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

Abstract

Maintaining subject consistency across multiple generated images remains a significant challenge in text-to-image (T2I) synthesis. Existing solutions typically rely on computationally expensive per-subject optimization or large-scale pre-training of external encoders. This paper presents ConsiStory, a training-free approach that achieves state-of-the-art subject consistency by sharing internal activations across a batch of images in real-time. By intervening in the self-attention mechanism and employing feature injection, ConsiStory enables the generation of consistent characters across diverse prompts up to 20 times faster than optimization-based methods.

1. Introduction

Large-scale diffusion models, such as Stable Diffusion XL (SDXL), have demonstrated remarkable capabilities in generating high-quality images from textual descriptions. However, these models often struggle with identity persistence; generating the same character in different contexts (e.g., "a cat in a hat" followed by "a cat in a boat") usually results in distinct visual identities.

Current approaches to this problem generally fall into two categories: optimization-based methods (like DreamBooth or LoRA) and encoder-based methods (like IP-Adapter). Optimization-based methods require several minutes of fine-tuning per subject, which is slow and prone to "language drifting," where the model loses its general generative capabilities. Encoder-based methods require massive datasets and extensive pre-training, often struggling with complex prompt adherence. ConsiStory addresses these limitations by providing a "zero-shot" consistency mechanism that requires no additional training or optimization.

2. Methodology

ConsiStory operates by synchronizing the internal representations of a diffusion model during the denoising process. The architecture is built upon three primary technical pillars:

2.1 Subject-Driven Self-Attention (SDSA)

In standard diffusion processes, each image in a batch is generated independently. ConsiStory modifies the self-attention layers to allow images within a batch to attend to subject-related patches in other images. By sharing "Keys" and "Values" across the batch, the model naturally synchronizes the appearance of the subject. The researchers observed that the exponential nature of the softmax function in the attention mechanism acts as a natural gate, preventing information leakage between semantically different subjects and making the method robust for multi-subject scenes.

2.2 Layout Diversity and Feature Injection

To prevent "layout collapse"—a phenomenon where shared information causes all images in a batch to adopt identical poses or backgrounds—ConsiStory utilizes Vanilla Query Blending and Attention Dropout. These strategies mix features from a standard, non-consistent generation pass to ensure structural variety.

For fine-grained texture consistency (such as the specific scales of a dragon), the method employs Diffusion Hyperfeatures (DIFT). DIFT creates a correspondence map between images, allowing the system to "inject" features from a source patch to a target patch, ensuring pixel-level identity across the batch.

2.3 Anchor Images and Personalization

The framework introduces Anchor Images, which serve as the identity reference for the generation batch. This allows for reusable subjects across different sessions. Furthermore, by utilizing Edit-Friendly DDPM-Inversion, ConsiStory can take a single real-world photograph and treat it as an anchor, enabling the consistent generation of real-world subjects in new scenes without gradient descent.

3. Evaluation and Results

To evaluate the method, the authors introduced a Consistency Evaluation Benchmark comprising 100 prompt sets across four categories: humans, animals, fantasy creatures, and inanimate objects. Performance was measured using CLIP-score (for text alignment) and DreamSim (for visual consistency).

3.1 Speed and Efficiency

ConsiStory demonstrates significant efficiency gains over existing baselines. It generates a consistent set of images in approximately 32 seconds on an NVIDIA H100 GPU. This represents a 25x speedup over optimization-based state-of-the-art methods like "The Chosen One" and is 8-14x faster than LoRA-based tuning.

3.2 Quantitative and Qualitative Performance

Quantitative analysis places ConsiStory on the Pareto front, providing the optimal trade-off between subject consistency and text alignment. In a large-scale user study involving 3,000 responses, participants consistently preferred ConsiStory over baselines such as IP-Adapter and LoRA-DreamBooth for both identity preservation and adherence to the input prompt.

4. Limitations and Future Work

While highly effective, ConsiStory relies on the base model's internal cross-attention maps to localize subjects. If the underlying model fails to accurately localize a subject—particularly in abstract or highly unusual styles—the consistency mechanism may fail. Additionally, the method currently faces challenges in decoupling style from identity; shared features often carry stylistic information, making it difficult to change the artistic medium of a subject while maintaining its exact identity.

Future research will focus on improving localization masks and developing more robust methods for disentangling subject identity from stylistic attributes.

5. Conclusion

ConsiStory represents a significant step forward in personalized image generation. By enforcing consistency during the denoising process rather than through post-hoc optimization, it offers a fast, training-free, and high-quality solution for maintaining identity in text-to-image workflows.

Summary updated

Abstract

Text-to-image models offer a new level of creative flexibility by allowing users to guide the image generation process through natural language. However, using these models to consistently portray the same subject across diverse prompts remains challenging. Existing approaches fine-tune the model to teach it new words that describe specific user-provided subjects or add image conditioning to the model. These methods require lengthy persubject optimization or large-scale pre-training. Moreover, they struggle to align generated images with text prompts and face difficulties in portraying multiple subjects. Here, we present ConsiStory, a training-free approach that enables consistent subject generation by sharing the internal activations of the pretrained model. We introduce a subject-driven shared attention block and correspondence-based feature injection to promote subject consistency between images. Additionally, we develop strategies to encourage layout diversity while maintaining subject consistency. We compare ConsiStory to a range of baselines, and demonstrate state-of-the-art performance on subject consistency and text alignment, without requiring a single optimization step. Finally, ConsiStory can naturally extend to multi-subject scenarios, and even enable training-free personalization for common objects.
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