Nodes/ComfyUI-AnimaDynamicCFG/Anima CFG Schedule
ComfyUI Node

Anima CFG Schedule

The everyday CFG ramp

By DanrisiUA·Created 3 months ago·Updated 3 months ago· 5
Anima CFG Schedule
  • model
  • MODEL
cfg_start5.5
cfg_end3.5
schedule
transition_start0.00
transition_end1.00

Think about what CFG is actually doing across a generation. Early on, the image is a noisy mess and you need the prompt to drag it into shape - high CFG keeps composition, anatomy and scene structure on the rails. Late in the run, the structure is decided and CFG mostly amplifies the base model's stylistic bias. On an anime-prior model that means the last steps are where it sneaks in flat shading and plastic skin. Anima CFG Schedule splits the difference by simply ramping CFG down as denoising progresses: high at the start for structure, low at the end to let realism through.

This is the workhorse of the DanrisiUA pack, and the design target is his own Anima realism fine-tunes - but it works on anything with a real CFG range. SDXL, Illustrious, Pony, whatever. If your model isn't guidance-distilled, this applies.

How the ramp works

Each step, the node derives denoising progress from the current sigma (the noise level), then interpolates CFG from cfg_start to cfg_end across that progress using the curve you pick. The CFG formula it hands the sampler is the standard one:

uncond + cfg * (cond - uncond)

It replaces ComfyUI's CFG function, so the CFG box on your KSampler stops doing anything. Set it to anything; the node owns it now.

The inputs that matter

  • cfg_start (5.5) and cfg_end (3.5) - the bookends. The README's recommendation for realism fine-tunes: start 5.5–7.0, end 3.0–4.0.
  • schedule - the curve between them. Cosine is the recommended default and the one people stick with: it lingers near the high value, eases through the middle, and settles gently at the low end. The others are worth knowing: sine holds high CFG longer before dropping fast, ease_in/ease_out bias one end or the other, linear is the honest straight line.
  • transition_start / transition_end (0 and 1) - where in the run the ramp happens. Default covers the whole denoising pass. Nudge transition_start up if you want the first few steps locked at cfg_start before the ramp begins.

Wiring it in

Model patch, one connection:

Checkpoint Loader → Anima CFG Schedule → KSampler

It's a sampler_cfg_function patch, so keep it to one CFG-family node in the chain. If you also want adaptive damping or rescaling, use the Advanced version instead of stacking this with other nodes from the same family - the last one wins and the first silently gets ignored.

Installing

ComfyUI Manager (search "AnimaDynamicCFG") or:

cd ComfyUI/custom_nodes
git clone https://github.com/DanrisiUA/ComfyUI-AnimaDynamicCFG.git

Restart, find it under Anima/sampling. No dependencies beyond torch, no models to download.

Gotchas

  • The ramp is per-step, so step count changes the feel. The same 5.5 → 3.5 cosine ramp over 20 steps vs 40 steps spends a different number of steps at each CFG value. Fewer steps means the transition happens faster in wall-clock terms, which can leave the low-CFG realism phase too short.
  • This is a schedule, not a sensor. It lowers CFG on a timer, whether or not the model is actually pushing its anime prior at that moment. If you want it to react to what the model does, that's Anima Adaptive CFG's job. They're siblings; they don't stack.
  • On distilled/Turbo checkpoints that run at CFG 1, skip this node entirely - there's no real CFG to schedule.
CategoryAnima/sampling

Inputs (6)

NameTypeDefaultDescription
modelMODEL
cfg_startFLOAT5.50–100
cfg_endFLOAT3.50–100
scheduleCOMBO6 options: linear, cosine, sine, ease_in, ease_out, ease_in_out
transition_startFLOAT0.000–1
transition_endFLOAT1.000–1

Outputs (1)

NameTypeDescription
MODELMODEL