Serving Input Number
Numeric arguments, clamped and stepped, straight from the request
- serving_config
- float_value
- int_value
- number_text
ServingInputNumber is the numeric sibling of ServingInputText: it reads a value out of the user's request and hands it to your workflow as a proper number, with min/max clamping and a step value applied so garbage can't reach your sampler. In a serving setup your users type !generate a cat --steps 20 --width 1024, and without a node like this, "20" and "1024" arrive as strings that could be anything. This node turns them into values you can safely feed a KSampler or a resolution calculator.
The README's warning is the best summary of why the clamps exist: set min, max, and step to the right values to avoid errors, with the concrete example of a width that doesn't divide by 16. Resolution calculators and many models want multiples of 8 or 16, and letting a user request width 1023 is a guaranteed bad time. The node protects you by forcing the parsed value into [min_value, max_value] and then snapping it to the nearest multiple of step (the code floors it down to the last step boundary, which is worth knowing if you're expecting rounding in either direction).
The inputs that matter:
argument- the argument name to read, default"number". Match it to what users type after--, e.g.--widthmeansargumentiswidth.default- the fallback when the user doesn't provide the argument.min_value/max_value- hard clamps. Values outside get pushed to the boundary.step- snapping granularity. Set to1for whole numbers,0.5for halves, and so on. Default 0.1.
Three outputs, which is a genuinely useful touch:
float_value- the value as a FLOAT, the one you'll usually wire onward.int_value- the same value rounded to an integer. Feed this into nodes that demand an INT (steps, seed-adjacent stuff, batch counts) without a conversion node.number_text- the value as a string, if you need it in a text pipeline.
One parsing detail: the node only accepts a value if it's numeric after stripping a single decimal point, and it validates against the incoming string - a user who types --steps banana just gets the default instead of an error, which is friendlier than crashing. But note the snap logic runs even on defaults, so if your default is 0.0 and your step is 0.1, everything is consistent; if you set a default that isn't a multiple of step, it'll be snapped down on the way out. Keep min/max/step sane and your users can't break the sampler from the chat box.
Install is the standard pack route - ComfyUI Manager, or git clone into custom_nodes + pip install -r requirements.txt. No model downloads, no extra dependencies beyond the shared toolkit. And as always in this pack, Auto Queue must be enabled for the node to keep receiving requests; if your numbers arrive once and then go silent, that toggle is the culprit.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| serving_config | SERVING_CONFIG | — | |
| argument | STRING | number | — |
| default | FLOAT | 0.0000-999999–999999 | — |
| min_value | FLOAT | -999999.0000-999999–999999 | — |
| max_value | FLOAT | 999999.0000-999999–999999 | — |
| step | FLOAT | 0.1000-999999–999999 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| float_value | FLOAT | — |
| int_value | INT | — |
| number_text | STRING | — |