ComfyUI Node Runs on cloud

Cfg Literal

One CFG value for the sampler and the saved metadata

By giriss·Created 3 years ago·Updated 19 days ago· 338
Cfg Literal
    • FLOAT
    float8.00

    Cfg Literal is a single float you type once and send two places: into your KSampler's cfg and into the Save Image w/Metadata node's cfg. That's the whole node - a number box that outputs a FLOAT. It looks pointless until you remember why the pack exists: the metadata saver records whatever CFG value you hand it, and if that number and the one your sampler actually ran disagree, your saved settings are wrong. Drive both from one Cfg Literal and they can't drift.

    CFG (classifier-free guidance) is how hard the model gets steered toward your prompt at each step. It's one of the two or three numbers people most want to reproduce from a good render, which is exactly why it's worth pinning down in a single place.

    How it works

    Type a value, the node outputs it as a float, you fan it out. Wire the output into the KSampler's cfg - you'll likely need to convert that widget to an input first (right-click the sampler, "Convert cfg to input", or drag the wire onto the field on newer ComfyUI) - and split the same wire into the save node. Now the CFG lives in one spot.

    Picking a value

    The right CFG is architecture knowledge, not taste. Rough sweet spots: 5-9 on SD 1.5 and SDXL, 4-6 on Pony and Illustrious, around 3.5 for Flux's guidance parameter, and - the big one for 2026 - 1 on anything distilled. Turbo, Lightning, Z-Image Turbo, Flux Schnell and every guidance-distilled release bake the guidance in, so a carried-over 7 applies it twice and burns the image into oversaturated, deep-fried mush. If output looks fried, lower CFG before touching anything else. If the model's ignoring your prompt, nudge it up inside the family's range. And tune it on a fixed seed, one value at a time, or you can't tell a real improvement from a luckier roll.

    The input and output

    • float (FLOAT, default 8, range 0-100) - the CFG value. Default 8 is a fine SDXL-era starting point; it is not what you want on a distilled model.

    The single output is FLOAT - the CFG, ready for the sampler and the metadata node.

    Installing it

    Ships with the pack. ComfyUI Manager: search Save Image with Generation Metadata, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/giriss/comfy-image-saver
    cd comfy-image-saver
    pip install -r requirements.txt
    

    Restart ComfyUI. No downloads.

    Where people get tripped up

    The recurring one: the KSampler's cfg is a widget, not a visible port, so if there's nowhere to plug the wire, convert it to an input. After that it's obvious.

    The subtler trap is the node's max of 100. That range is not an invitation - anything above roughly 12 on SD-lineage models starts to burn, and distilled models fall apart far lower. High numbers here don't mean "more prompt adherence", they mean "cooked". This node doesn't change how CFG behaves; it just makes sure the value you chose is the value your metadata reports. Whether that value is good is the model-card question above.

    CategoryImageSaverTools/utils

    Inputs (1)

    NameTypeDefaultDescription
    floatFLOAT8.000–100

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT