yuval-alaluf/Attend-and-Excite
An attention-based technique for improving Stable Diffusion's ability to generate all subjects described in text prompts by guiding cross-attention during inference.

Attend-and-Excite is a Generative Semantic Nursing method that intervenes in the diffusion model’s inference process to improve faithfulness of generated images. It analyzes Stable Diffusion’s cross-attention units to identify and strengthen activations for subject tokens that may be neglected during generation. The approach guides the model to attend to all subject tokens in the text prompt and excite their activations, helping ensure all described subjects appear in the final image.