Nodes/ComfyUI-CitronNodes/Cfg Literal (Citron Image Saver)
ComfyUI Node

Cfg Literal (Citron Image Saver)

One CFG value for your sampler and your metadata, 0 to 100

By citronlegacy·Created about a year ago·Updated 22 days ago· 0
Cfg Literal (Citron Image Saver)
    • value
    ◄cfg7.00►

    A float box that outputs a CFG value. The tooltip is the author's own: "CFG as a floating point number", output named value and described as cfg (FLOAT). Range 0 to 100, default 7.

    It's a primitive, so the interesting question isn't what it does, it's why CFG got its own node while other floats didn't. The answer is that CFG is the one setting people tune twice in the same graph - base pass and hires pass often want different values - and it's the setting most likely to be misreported, because the save node's cfg input sits there defaulting to 7 no matter what your sampler ran.

    How it works

    One required input, cfg, a float between 0 and 100. One output, value, a FLOAT. Pass-through, no clipping, no logic.

    Wire it into a converted cfg input on your KSampler and into the saver's cfg input, and the two can't disagree. The default of 7 is the classic SD 1.5/SDXL value, which makes it a good example of a default that's now often wrong: on distilled, turbo, lightning and most flow-matching models the model card wants something near 1, sometimes 3.5–5 for a guidance-scaled Flux, and a leftover 7 will burn colour saturation and crush detail while the workflow still "works". If a downloaded graph produces chalky, over-contrasted images, the CFG is the first thing to look at.

    The 0–100 ceiling is generous by 2026 standards - nothing intelligible lives above about 15, and LoRA-specific quirks aside, the entire useful SD range is 1–12. But it costs nothing, and it means the node can't be the thing that blocks you.

    One behaviour that's worth understanding because it explains a lot of confusing metadata: at CFG exactly 1, ComfyUI doesn't compute the unconditional prediction at all. That's the reason guidance-distilled models get their speedup - no second pass per step. It's also why the negative prompt in your file did nothing on that run, and why some _cfg_pp samplers (which depend on the unconditional prediction) cost more than plain Euler at the same CFG. If you're saving with cfg wired in, the number in the file will at least tell you which regime you were in.

    Why not just use ComfyUI's PrimitiveFloat? You can - it works fine here. This node's only advantage is that it's paired with the pack's other literals so the whole parameter block reads consistently on the canvas, and its range is a sane CFG range rather than the full float spectrum. If you already have a primitive workflow going, don't install a pack for this.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/citronlegacy/ComfyUI-CitronNodes
    # restart ComfyUI
    

    Manager search is unreliable for this pack - the README says "coming soon", the repo's package metadata is placeholder - so clone. piexif is the sole pip dependency and the pack won't import without it:

    pip install piexif
    

    No models. It's under Citron_ImageSaver/utils.

    Common issues

    • Sampler still uses its own CFG. The widget has to be converted to an input before a wire will override it, and if it isn't, the widget wins.
    • The file says CFG 7 and I ran 4.5. The saver's cfg input wasn't wired - that's its default.
    • CFG 1 produces flat, prompt-ignoring images. Expected on a non-distilled model; CFG 1 on a model that isn't guidance-distilled means you turned guidance off.
    • Need a negative CFG or a huge one. The range stops at 0 and 100. Negative CFG isn't a thing these samplers support anyway.
    CategoryCitron_ImageSaver/utils

    Inputs (1)

    NameTypeDefaultDescription
    cfgFLOAT7.000–100CFG as a floating point number

    Outputs (1)

    NameTypeDescription
    valueFLOATcfg (FLOAT)