Nodes/ComfyUI-BerniniR Wrapper/Bernini-R Apply NAG
ComfyUI Node

Bernini-R Apply NAG

Attaches NAG (Normalized Attention Guidance) data to the positive conditioning and passes through negative for CFG. Connect the same negative prompt used for CFG as the NAG guidance signal. If negative is not connected, both outputs pass through unchanged (NAG disabled). https://github.com/ChenDarYen/Normalized-Attention-Guidance

By xiaolibai-sys·Created about a month ago·Updated 28 days ago· 8
Bernini-R Apply NAG
  • positive
  • negative
  • positive
  • negative
nag_scale11.0
nag_tau2.5
nag_alpha0.25
inplacetrue
CategoryBernini-R/Conditioning

Inputs (6)

NameTypeDefaultDescription
positiveCONDITIONINGPositive text conditioning
nag_scaleFLOAT11.00–100NAG guidance strength. Higher = stronger attention steering
nag_tauFLOAT2.50–10Norm-clamp threshold. Controls how aggressively outlier attention is suppressed
nag_alphaFLOAT0.250–1Blend factor between original and NAG-steered attention
negativeoptCONDITIONINGNegative text conditioning (used for both CFG and NAG guidance)
inplaceoptBOOLEANtrueReuse tensors in-place to save VRAM

Outputs (2)

NameTypeDescription
positiveCONDITIONING
negativeCONDITIONING