Anima CFG Schedule
The everyday CFG ramp
- model
- MODEL
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) andcfg_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:sineholds high CFG longer before dropping fast,ease_in/ease_outbias one end or the other,linearis the honest straight line.transition_start/transition_end(0 and 1) - where in the run the ramp happens. Default covers the whole denoising pass. Nudgetransition_startup if you want the first few steps locked atcfg_startbefore 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| cfg_start | FLOAT | 5.50–100 | — |
| cfg_end | FLOAT | 3.50–100 | — |
| schedule | COMBO | 6 options: linear, cosine, sine, ease_in, ease_out, ease_in_out | |
| transition_start | FLOAT | 0.000–1 | — |
| transition_end | FLOAT | 1.000–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |