Automatic CFG - Excellent attention
The author's 'just try it' attention patch, defaults included
- model
- attn_mod_for_positive_operation
- attn_mod_for_negative_operation
- Model
- Parameters as string
This is the node the author is least bashful about. The README's instructions are basically "just try it" - it's a self-contained attention experiment with sensible defaults that disables input layer 8 on the UNet and applies a custom modification to cross-attention middle layer 0. The "Excellent attention" preset is the default selection in the Preset Loader, and this node is the standalone, knob-exposed version of the same thing.
If you want one attention experiment that's mostly safe, pre-tuned, and easy to reason about, this is the one to grab. It's not a general-purpose CFG patch like the main node - it's a specific, opinionated modification with a handful of toggles around it.
What it actually does
Two concrete patches, both visible in the source:
- Input layer 8 mute. Input block 8's self-attention (attn1) can be zeroed out (or bypassed) independently for the cond and uncond passes. Layer 8 is late in the UNet's input stack, close to where structure meets detail, so killing it changes how strongly early feature maps get re-attended. The defaults mute it for the uncond pass but leave cond alone.
- Cross-attention middle layer 0 modification. Middle layer 0's cross-attention (attn2) gets an expression that amplifies how far attention output deviates from the standard attention:
normalize(q + (q - attention_basic(...))) * norm, scaled bypatch_multiplier. The author says the multiplier "reinforces prompt-following. But like for real." Thelight_patchtoggle swaps this for a cheapq * multiplierthat uses far less VRAM, and the README says it actually works better for this purpose.
The inputs that matter
- patch_multiplier - strength of the cross-attention middle-layer-0 modification. This is your main quality dial.
- patch_cond / patch_uncond - whether the modification applies to the positive and/or negative pass.
- light_patch - the cheap, lower-VRAM variant. The author recommends trying it on.
- mute_self_input_layer_8_cond / _uncond and mute_cross_input_layer_8_cond / _uncond - which input-layer-8 attentions get zeroed, per pass. Defaults: uncond self-attention muted, everything else off.
- bypass_layer_8_instead_of_mute - instead of zeroing layer 8, replace it with the identity (
q). Gentler. - uncond_sigma_end - where the negative-side patches stop (default 1).
- Auto_CFG - on by default, wrapping everything in the automatic CFG rescaling; off for raw guidance.
Optional attn_mod_for_positive_operation / attn_mod_for_negative_operation let you bolt extra ATTNMOD modifiers onto each pass.
Outputs
A patched MODEL for the KSampler, plus a Parameters as string mirroring everything you set - handy when you want to log or save a configuration.
Notes and a genuine mystery
The README is upfront that "for some reason the Juggernaut model does not work with it and I have no idea why" - so if a specific SDXL checkpoint renders wrong with this node, it's probably the checkpoint, not you. Also note the pack's recurring caveat: Juggernaut aside, most testing was on SDXL, and unknown behavior on SD 1.5 is common across all the attention nodes here.
Install is the pack-wide one-liner (git clone https://github.com/Extraltodeus/ComfyUI-AutomaticCFG into custom_nodes, restart). And because this patch also depends on the pack's global sampler-function hook, "update your ComfyUI" remains the first move when outputs turn black or error. If "just try it" appeals to you more than reading about it - which the author clearly hopes - this is the node to try.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| Auto_CFG | BOOLEAN | true | — |
| patch_multiplier | FLOAT | 10–100 | — |
| patch_cond | BOOLEAN | true | — |
| patch_uncond | BOOLEAN | true | — |
| light_patch | BOOLEAN | false | — |
| mute_self_input_layer_8_cond | BOOLEAN | false | — |
| mute_cross_input_layer_8_cond | BOOLEAN | false | — |
| mute_self_input_layer_8_uncond | BOOLEAN | true | — |
| mute_cross_input_layer_8_uncond | BOOLEAN | false | — |
| uncond_sigma_end | FLOAT | 1.00–10000 | — |
| bypass_layer_8_instead_of_mute | BOOLEAN | false | — |
| save_as_preset | BOOLEAN | false | — |
| preset_name | STRING | — | |
| attn_mod_for_positive_operationopt | ATTNMOD | — | |
| attn_mod_for_negative_operationopt | ATTNMOD | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| Model | MODEL | — |
| Parameters as string | STRING | — |