Cfg Literal (Image Saver)
Define your CFG once so the sampler and the metadata agree
- value
It's a node whose only job is to output a CFG value as a float. That sounds almost too simple to warrant a node - until you remember what the Image Saver pack is for. The saver can't read the CFG out of your KSampler, so if you want it in the metadata you have to feed it separately. Cfg Literal lets you set the number in one place and route it to both the sampler and the saver, so the CFG recorded in your image is the CFG that actually made it. Define once, use twice.
How it works
There's no mechanism to speak of - you type a number between 0 and 100 and it comes out the other side as a FLOAT. The value is what matters, not the plumbing. Wire it to your KSampler's cfg input and to your Image Saver / Image Saver Metadata cfg field, and the two can't disagree.
CFG (classifier-free guidance) is how hard the model is pushed to follow your prompt versus letting it do its own thing. Low, and it drifts off-prompt and looks washed out; high, and it over-bakes - oversaturated colours, hard edges, that "fried" look. The sweet spot is model-dependent, which is exactly why getting it recorded matters.
The inputs and outputs that matter
- cfg - a float from 0.0 to 100.0, default 7.
The single output is a FLOAT labelled value - send it to the sampler and the saver.
Installing it
ComfyUI Manager: search ComfyUI Image Saver, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/alexopus/ComfyUI-Image-Saver
cd ComfyUI-Image-Saver
pip install -r requirements.txt
Restart, hard-refresh. No downloads.
Where people get tripped up
The value itself is where the real trap is, and it's not the node's fault. The default 7 is the SD 1.5 / SDXL comfort zone (roughly 5–9), but it's flat wrong on newer models. Flux Dev doesn't use CFG the normal way at all - it wants a low guidance value around 3.5. Flow-matching models like Z-Image sit around 3–5, and guidance-distilled or "Turbo/Lightning" checkpoints often want CFG near 1. Crank a distilled model to 7 and you get blown-out, fried images. So set this to whatever your model actually wants, not the default.
Beyond that, the usual pack caveat applies: routing the value only to the sampler leaves the saver guessing. Feed both, or the whole reason for using a literal node evaporates. If you're setting several parameters this way, the Input Parameters node bundles CFG together with seed, steps, sampler and scheduler and saves you the wiring - for most runs that's the node you actually want, and Cfg Literal is really for the case where you're routing CFG on its own.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| cfg | FLOAT | 7.000–100 | CFG as a floating point number |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | FLOAT | cfg (FLOAT) |