Skip to main content
The Self-Attention Guidance node applies guidance to diffusion models by modifying the attention mechanism during the sampling process. It captures attention scores from unconditional denoising steps and uses them to create blurred guidance maps that influence the final output. This technique helps guide the generation process by leveraging the model’s own attention patterns.

Inputs

ParameterDescriptionData TypeRequiredRange
modelThe diffusion model to apply self-attention guidance toMODELYes-
scaleThe strength of the self-attention guidance effect (default: 0.5)FLOATNo-2.0 to 5.0
blur_sigmaThe amount of blur applied to create the guidance map (default: 2.0)FLOATNo0.0 to 10.0

Outputs

Output NameDescriptionData Type
modelThe modified model with self-attention guidance appliedMODEL
Note: This node is currently experimental and has limitations with chunked batches. It can only save attention scores from one UNet call and may not work properly with larger batch sizes.
This documentation was AI-generated. If you find any errors or have suggestions for improvement, please feel free to contribute! Edit on GitHub

Source fingerprint (SHA-256): ab8f7a0cf19c85f8e77b2d6b380c0224a407a900a42341de7503f5394a3216fb