Nodes/ComfyUI INOUT/Schema Integer Parameter
ComfyUI Node

Schema Integer Parameter

Whole numbers with a contract for your agent

By Liquid-XO·Created 6 months ago·Updated 5 months ago· 0
Schema Integer Parameter
    • value
    nameparameter_name
    io_kindinput
    description
    requiredtrue
    default0
    ge-2147483648
    gt-2147483648
    le2147483647
    lt2147483647
    multiple_of0
    value_in

    Seeds, dimensions, batch counts, steps, iterations - half the numeric knobs in a ComfyUI workflow are whole numbers, and when an agent is driving the graph it needs to know which of those it's allowed to touch and within what range. That's this node: a typed INT field with bounds your tool can validate against before a run, instead of the agent blindly shoving -42 into a seed and hoping.

    It's one of the eight parameter nodes in ComfyUI_SchemaNodes. All of them share the same base fields - name, io_kind (input/output), description, required - and the integer node is where you'll see the numeric constraint machinery at its cleanest.

    The inputs that matter

    • name / description - same contract-writing advice as everywhere in this pack: a stable identifier and a description written for a machine to read.
    • io_kind - input says the agent supplies this before the run; output lets another node's result (a count, a chosen seed) be surfaced as a deliverable.
    • default - the fallback when nothing is wired in.
    • ge, gt, le, lt - the guardrails: greater-or-equal, greater-than, less-or-equal, less-than. These map directly to JSON Schema minimum, exclusiveMinimum, maximum, exclusiveMaximum. The defaults are the int32 extremes (-2147483648 / 2147483647), which is the pack's way of saying "not set" - if you leave them alone, they're not added to the schema at all. So you don't have to clear them; you just set the ones you care about.
    • multiple_of - a value like 8 forces the field to land on multiples of 8 (handy for latent-friendly resolutions). It maps to JSON Schema multipleOf.
    • value_in (INT, forced input) - wire something in and it overrides default, the same override pattern every node in this pack uses.

    How it works

    Execution is boring in the best way: it resolves value to value_in or default, coerces to int, and hands it down the graph as a plain INT. The interesting part is what your tool sees. When an agent parses the workflow JSON, it reads those widget values and builds a JSON Schema fragment - "type": "integer", "minimum": 512, "maximum": 2048, "multipleOf": 8 - and can validate the value before sending it to the API. That's the whole point of the pack: you're not just labeling a knob, you're publishing its contract.

    The node always executes too - the base class sets IS_CHANGED to a NaN sentinel, so ComfyUI never skips it as "unchanged." For a parameter node that's what you want: the current value always flows through.

    Installing it

    Same story as the rest of the pack - one install gets you all eight nodes.

    cd ComfyUI/custom_nodes
    git clone https://github.com/Liquid-XO/ComfyUI_SchemaNodes
    

    Restart ComfyUI (or install via ComfyUI Manager, search "ComfyUI SchemaNodes"). No pip dependencies, no model files, no API keys. The code only touches libraries ComfyUI already bundles.

    Common gotchas

    • Don't rely on the node to enforce bounds at runtime. The ge/gt/le/lt constraints are metadata for whoever parses the workflow - the node itself won't clamp or reject a wired-in value that violates them. If you're injecting values via value_in, your tool is the enforcement point.
    • The "not set" sentinel can bite you if you copy workflows blindly. ge defaults to int32-min and le to int32-max, so an untouched node emits no minimum/maximum at all. That's correct behavior, but it means "I didn't see a range" does not mean the field is unconstrained by intent - it's just unconstrained.
    • A seed that's output mode is weird but useful. Wire a seed picker into it and the agent gets the actual seed used back as a result, which matters if you're doing reproducibility bookkeeping on a batch run.
    Categoryinout/schema

    Inputs (11)

    NameTypeDefaultDescription
    nameSTRINGparameter_name
    io_kindCOMBOinput2 options: input, output
    descriptionSTRING
    requiredBOOLEANtrue
    defaultINT0-2147483648–2147483647
    geINT-2147483648-2147483648–2147483647
    gtINT-2147483648-2147483648–2147483647
    leINT2147483647-2147483648–2147483647
    ltINT2147483647-2147483648–2147483647
    multiple_ofINT00–2147483647
    value_inoptINT

    Outputs (1)

    NameTypeDescription
    valueINT