⚙️ Advanced CFG Controller (Expert)
Every knob on the sampler's steering wheel
- model
- attention_modifiers_positive
- attention_modifiers_negative
- attention_modifiers_fake_negative
- attention_modifiers_global
- MODEL
- STRING
The Expert node is the engine room of the Advanced CFG Controller pack. Where the Easy Mode node hides everything behind presets, this one hands you fifty-plus parameters and trusts you not to break anything. Same underlying machinery - it clones your model, swaps in its own step-by-step CFG function, and adds hooks around the conditional and unconditional passes - but now every dial is exposed, and the sigma windows are the raw values instead of friendly "from step / until step" numbers.
Before you commit an afternoon to it, the same caveat as the Easy version: this pack is built for classic DDPM models (SD 1.5, SDXL, and their fine-tunes) that run real CFG. On a guidance-distilled model that lives at CFG 1 there's no uncond pass to amplify or skip, so the whole premise collapses. It's also a fresh, single-commit pack from FlareAI-Studios - no community track record, so treat behavior as subject to change.
The sections, grouped
The inputs sort into families, and knowing the family beats memorizing names:
- Adaptive CFG -
adaptive_cfg(Disabled / Soft Intensity / Hard Intensity / Hard Squared / Range Based / Spectral Analysis),adaptive_cfg_topk, andadaptive_cfg_ref. This measures the latent's intensity each step and steers the effective scale towardadaptive_cfg_ref(default 8). Loweradaptive_cfg_topk= finer measurement, slower. - Skip the negative -
skip_uncondplusuncond_sigma_start/endcontrols the window where the unconditional pass is skipped (your speed boost).fake_uncond_startand thefake_uncond_exp*family decide what substitutes for the real negative:fake_uncond_exp_methodoffers a huge menu (Use Positive, Zero Tensor, Sine Wave, Amplify, even "The Darkness"),fake_uncond_exp_valueits strength,fake_uncond_multiplierflips it to -1, 0, or 1. - Blending -
lerp_uncondblends positive and negative predictions together within a sigma window;lerp_uncond_strengthis how hard. - Post-CFG color -
subtract_latent_meanfixes color drift by centering latent values,latent_intensity_rescalerescales intensity againstlatent_intensity_rescale_cfg(8 = the reference). Both have sigma start/end windows. - Prompt shaping -
cond_exp/uncond_expapply math transforms (amplify, root power, error function, sine…) to the positive or negative conditioning, each with its own method dropdown and value. - Wildcard stuff -
disable_cond(turn the positive prompt off inside a window),adaptive_noise_strength,spectral_norm_target,frequency_filter_cutoff,dynamic_range_compression,enable_performance_monitoring.
The attention modifier inputs
This is what makes the Expert node the center of the pack. Four optional inputs - attention_modifiers_positive, attention_modifiers_negative, attention_modifiers_fake_negative, and attention_modifiers_global - accept the pack's custom ATTNMOD wire type, produced by its Attention Modifier nodes. Those plug in as Python-expression attention replacements at specific UNet blocks, active only within sigma ranges. This is genuinely fiddly, experimental territory; start with the positive slot and one modifier, not all four.
Outputs are the patched MODEL and a STRING - a dump of every parameter you passed. Because the STRING output carries the full settings, you can wire it into a text node to save a "recipe" of a working config. args_filter (optional, multiline) trims which parameters appear in that string.
Install and where it lives
Same pack, same install: Manager → search Advanced CFG Controller, or clone into custom_nodes and restart:
cd ComfyUI/custom_nodes
git clone https://github.com/FlareAI-Studios/advanced-cfg-controller
No model downloads, no heavy deps (torch/numpy/colorama only). It lives under model_patches/Advanced_CFG_Controller, with the attention modifiers and utilities in subfolders.
Practical advice
The sigma defaults (start 1000, end 1) are sized for a full-range SDXL sampler: the 1000 ceiling never actually triggers, and the 1 floor means the negative pass is skipped only in the final fine-detail steps (sigma < 1) - a gentle default, not the drastic speed-up the toggles promise. If you want the real speed boost, widen that window toward your sampler's middle sigmas. Don't touch everything at once - the pack's own monkeypatch of ComfyUI's global sampling function means mistakes can bleed into other nodes, and a restart clears it. My honest recommendation: get comfortable with adaptive_cfg, skip_uncond, and the two color-fix toggles first. If you still need fake_uncond_exp_method at "The Darkness," you've gone off the deep end - and that's fine, just save the settings string so you can come back.
Inputs (53)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| adaptive_cfg | COMBO | Hard Intensity | 6 options: Disabled, Soft Intensity, Hard Intensity, Hard Squared, Range Based, Spectral Analysis |
| adaptive_cfg_topk | FLOAT | 0.250–0.5 | Top-K percentage for intensity measurement (lower = more precise) |
| adaptive_cfg_ref | FLOAT | 8.00–100 | Reference CFG value for adaptive scaling |
| skip_uncond | BOOLEAN | true | Skip negative prompt calculation for speed boost |
| uncond_sigma_start | FLOAT | 1000.00–10000 | Start skipping negative at this sigma level |
| uncond_sigma_end | FLOAT | 1.00–10000 | Stop skipping negative at this sigma level |
| fake_uncond_start | BOOLEAN | false | Use fake negative prompt when skipping |
| fake_uncond_exp | BOOLEAN | false | Apply experimental modifications to fake negative |
| fake_uncond_exp_method | COMBO | Use Positive | Method for generating fake negative prompt |
| fake_uncond_exp_value | FLOAT | 2.00–1000 | Strength value for fake negative method |
| fake_uncond_exp_normalize | BOOLEAN | false | Normalize fake negative to preserve magnitude |
| fake_uncond_multiplier | INT | 1-1–1 | Multiplier for fake negative (-1, 0, or 1) |
| fake_uncond_sigma_start | FLOAT | 1000.00–10000 | Start using fake negative at this sigma |
| fake_uncond_sigma_end | FLOAT | 1.00–10000 | Stop using fake negative at this sigma |
| lerp_uncond | BOOLEAN | false | Blend positive and negative prompts |
| lerp_uncond_strength | FLOAT | 2.00–10 | Blending strength (higher = more negative influence) |
| lerp_uncond_sigma_start | FLOAT | 1000.00–10000 | Start blending at this sigma level |
| lerp_uncond_sigma_end | FLOAT | 1.00–10000 | Stop blending at this sigma level |
| subtract_latent_mean | BOOLEAN | false | Fix color drift by centering latent values |
| subtract_latent_mean_sigma_start | FLOAT | 1000.00–10000 | Start color correction at this sigma |
| subtract_latent_mean_sigma_end | FLOAT | 1.00–10000 | Stop color correction at this sigma |
| latent_intensity_rescale | BOOLEAN | false | Rescale latent intensity to prevent oversaturation |
| latent_intensity_rescale_method | COMBO | Hard Measurement | Method for measuring latent intensity |
| latent_intensity_rescale_cfg | FLOAT | 8.00–100 | Target intensity level for rescaling |
| latent_intensity_rescale_sigma_start | FLOAT | 1000.00–10000 | Start rescaling at this sigma |
| latent_intensity_rescale_sigma_end | FLOAT | 3.00–10000 | Stop rescaling at this sigma |
| cond_exp | BOOLEAN | false | Apply experimental modifications to positive prompt |
| cond_exp_normalize | BOOLEAN | false | Normalize positive prompt to preserve magnitude |
| cond_exp_sigma_start | FLOAT | 1000.00–10000 | Start modifications at this sigma |
| cond_exp_sigma_end | FLOAT | 1.00–10000 | Stop modifications at this sigma |
| cond_exp_method | COMBO | Amplify | Modification method for positive prompt |
| cond_exp_value | FLOAT | 2.00–100 | Strength value for positive modification |
| uncond_exp | BOOLEAN | false | Apply experimental modifications to negative prompt |
| uncond_exp_normalize | BOOLEAN | false | Normalize negative prompt to preserve magnitude |
| uncond_exp_sigma_start | FLOAT | 1000.00–10000 | Start modifications at this sigma |
| uncond_exp_sigma_end | FLOAT | 1.00–10000 | Stop modifications at this sigma |
| uncond_exp_method | COMBO | Amplify | Modification method for negative prompt |
| uncond_exp_value | FLOAT | 2.00–100 | Strength value for negative modification |
| attention_modifiers_global_enabled | BOOLEAN | false | Enable global attention modifications |
| disable_cond | BOOLEAN | false | Disable positive prompt in specified range |
| disable_cond_sigma_start | FLOAT | 1000.00–10000 | Start disabling positive at this sigma |
| disable_cond_sigma_end | FLOAT | 0.00–10000 | Stop disabling positive at this sigma |
| enable_performance_monitoring | BOOLEAN | false | Track performance metrics during generation |
| adaptive_noise_strength | FLOAT | 0.000–1 | Strength of adaptive noise injection |
| spectral_norm_target | FLOAT | 1.00.1–5 | Target norm for spectral normalization |
| frequency_filter_cutoff | FLOAT | 0.500.1–1 | Cutoff frequency for frequency domain filtering |
| dynamic_range_compression | FLOAT | 1.000.1–1 | Dynamic range compression ratio (1.0 = disabled) |
| args_filteropt | STRING | Comma-separated list of parameters to include in output | |
| attention_modifiers_positiveopt | ATTNMOD | Attention modifications for positive prompt | |
| attention_modifiers_negativeopt | ATTNMOD | Attention modifications for negative prompt | |
| attention_modifiers_fake_negativeopt | ATTNMOD | Attention modifications for fake negative | |
| attention_modifiers_globalopt | ATTNMOD | Global attention modifications |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| STRING | STRING | — |