ComfyUI Node

AIHub Expose CFG

Exposing CFG the smart way — one that snaps to the model's default

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Expose CFG
    • FLOAT
    idcfg
    labelCfg
    tooltip
    value3.00
    advancedfalse
    index0
    unaffected_by_model_cfgfalse

    AIHub Expose CFG is the cfg-specific member of this pack's expose family, and it exists for a genuinely good reason: different models want different CFG values, and a workflow that lets the client pick the model needs its CFG to follow along. Plain AIHub Expose Float just hands through a number. This node knows about model defaults - if the workflow uses an AIHubExposeModel, the CFG value defaults to whatever that model's metadata says (default_cfg in the model's config), so a beginner doesn't have to know that model A likes 3.0 and model B wants 7.0. The README's own note is the best summary: the defaulting is a client-side feature; the node itself just exposes a float.

    Same pack context as always - otavanopisto's ComfyUI-aihub-workflow-exposer turns ComfyUI into the generation engine for another app, and expose nodes are the inputs the client fills in over the pack's own websocket (port 8111).

    How it works

    The node returns the CFG value as a FLOAT. The cleverness is in the model coupling: when a model is exposed in the same workflow, the client adjusts this field's default to the model's default_cfg - unless you've set unaffected_by_model_cfg, in which case your value stands and the model's default is ignored. The client does the adjusting; the node just validates the value (clamped to 0–100, and it errors on negatives) and passes it through.

    The inputs that matter

    • id - the unique field id (default cfg). Keep it stable; it's the contract with the client and with condition expressions.
    • label - what the client UI shows.
    • value - the CFG default (default 3.0).
    • unaffected_by_model_cfg - the one that matters. Leave it false (the default) and the field inherits the exposed model's default CFG; set it true to force your value regardless of model. If your workflow doesn't expose a model, this flag is a no-op.
    • advanced - hide under the client's advanced options.
    • index - field sort order.

    The output

    • FLOAT - the CFG value. Wire it into the sampler's cfg input (or wherever your workflow takes a float).

    Installing it

    ComfyUI Manager (search "ComfyUI-aihub-workflow-exposer"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer
    # restart ComfyUI
    

    No requirements, no downloads.

    Where people get burned

    The number one confusion is expecting this node to change the model's behavior - it doesn't, it just supplies the number. The model-coupling magic only works when an AIHubExposeModel is in the same workflow, and only when the client implements the defaulting (the stock UI won't do the model look-up for you). Also note CFG itself is a moving target in 2026: guidance-distilled, flow-matching models often want CFG 1 (or none at all), so "the model default" can legitimately be 1.0 - don't assume a bigger number is better.

    Categoryaihub/expose

    Inputs (7)

    NameTypeDefaultDescription
    idSTRINGcfgA unique custom id for this workflow.
    labelSTRINGCfgThis is the label that will appear in the field.
    tooltipSTRINGAn optional tooltip.
    valueFLOAT3.00
    advancedBOOLEANfalseIf set to true, it will make this option be hidden under advanced options for this workflow.
    indexINT0This value is used for sorting the input fields when displaying; lower values will appear first.
    unaffected_by_model_cfgBOOLEANfalseIf set to true, this cfg value will not be affected by the model's default cfg

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT