Custom CFG Keyframes Interp. ππ π
Ramp CFG smoothly across the render
- prev_custom_cfg
- cfg_extras
- CUSTOM_CFG
The smooth-curve version of a Custom CFG schedule: instead of a list of values, give this node a starting CFG, an ending CFG, and how many steps to interpolate across, and it builds an evenly-spaced ramp between them.
What it does
cfg_start and cfg_end (both default 8, range 0β100) are the two ends of the ramp - 8 being the classic SD 1.5-era default CFG, which makes sense as a starting point given AnimateDiff's SD 1.5 roots. start_percent and end_percent (0 and 1) bound where in the sampling process the ramp happens. interpolation is a dropdown for the curve shape - linear versus an eased ramp that moves more gradually at one or both ends. intervals (default 50, range 2β100) is how many keyframes the curve gets broken into. print_keyframes (default false) prints the generated schedule to console - worth switching on while you're first dialing in a new ramp.
prev_custom_cfg chains onto an existing Custom CFG schedule, and cfg_extras is the same pack-wide escape hatch the rest of this family exposes. Output is CUSTOM_CFG.
A concrete shape worth trying
Start cfg_start around 8β9 for strong composition and prompt adherence in the opening steps, ramp down to cfg_end around 4β5 by the end. That mirrors general SD guidance - CFG in the 5β9 range is the normal working band for SD 1.5/SDXL-based generation, and pushing much past that tends to burn and oversaturate - just applied as a gradient across the render instead of one fixed number for every frame.
Picking an intervals count
More intervals gives a smoother CFG ramp but also means more keyframe objects for the sampler to step through during the render - a real, if minor, overhead. Since CFG is usually meant to change gradually rather than in fine, imperceptible steps, something in the 10-20 range is generally enough; reserve values near the 100 ceiling for a render where you're deliberately chasing a very precise, almost continuous transition between cfg_start and cfg_end.
Installing it
ComfyUI Manager: search AnimateDiff Evolved, author Kosinkadink, install, restart. Or git clone https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved into custom_nodes manually and restart.
Common issues
Setting cfg_start and cfg_end both to values in the double digits ramps between two already-high settings rather than actually easing off - if you're chasing the "strong start, softer finish" effect, make sure cfg_end is genuinely lower than cfg_start, not just a slightly different high number. And as with the other list and interpolation nodes in this pack, print_keyframes is there specifically so you're not guessing what the ramp produced from slider positions alone - use it.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| start_percent | FLOAT | 0.0000β1 | β |
| end_percent | FLOAT | 1.0000β1 | β |
| cfg_start | FLOAT | 8.00β100 | β |
| cfg_end | FLOAT | 8.00β100 | β |
| interpolation | COMBO | 4 options: linear, ease_in, ease_out, ease_in_out | |
| intervals | INT | 502β100 | β |
| print_keyframes | BOOLEAN | false | β |
| prev_custom_cfgopt | CUSTOM_CFG | β | |
| cfg_extrasopt | CFG_EXTRAS | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CUSTOM_CFG | CUSTOM_CFG | β |