External Number Slider Int (ComfyUI Deploy)
The Integer Slider for When Steps and Counts Are API Inputs
- value
The float slider's integer sibling, and honestly the one you'll wire up more often once you actually deploy. ComfyUIDeployExternalNumberSliderInt exposes a whole-number parameter to the ComfyUI Deploy API - think sampling steps, batch size, frame counts, or "which of these styles" pickers that happen to be integers. Same family, same mechanism, one type difference.
How it works
Identical contract to its float cousin. The input_id (default input_number_slider_int) is the key a remote caller sends in the request body. Locally, run() tries int(round(float(input_id))), the literal string fails, and the node hands you default_value - so your local preview is just "whatever default you set." Through the deployed API the backend swaps the caller's number into input_id, the conversion succeeds, and the value is returned only if it sits between min_value and max_value. Out of range, back to the default.
The int(round(float(...))) detail is worth knowing: it rounds, so a caller who sends 6.7 gets 7, not an error. That's friendly for a form with a slider that only emits integers, and slightly sloppy if you expected strict typing - but for a public API it beats rejecting the request.
The inputs that matter
input_id- the request key. Defaultinput_number_slider_int; rename it if you want the API JSON to read naturally.default_value(1) - your local preview value and the fallback on any range miss.min_value/max_value(0 / 10) - the slider range in the generated form and the gate on the API.display_name/description- label and help text for the dashboard form. Fill them in; your future self calling this API from a script will thank you.
Output is a single value (INT), ready for a KSampler's steps, a batch_size, or any integer socket. The VHS-based video loader in this pack even documents feeding external number nodes into seed and frame-count slots - it's the standard way to make counts dynamic.
Installing
Same pack, same drill: ComfyUI Manager → "ComfyUI Deploy", or
cd ComfyUI/custom_nodes
git clone https://github.com/BennyKok/comfyui-deploy
restart, done. No models, no GPU deps - the pack's requirements.txt is all lightweight Python plumbing.
Gotchas
Two things catch people. First, the silent-default behavior: a value outside min/max doesn't error, it just returns default_value, which can look like the API "ignored" their input. Second, the range widgets here are wide-open (min allows negatives, max allows huge numbers), so the only real limits are the ones you set - pick sensible bounds or a caller can genuinely ask for a million steps.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| input_id | STRING | input_number_slider_int | — |
| default_valueopt | INT | 1-2147483647–2147483647 | — |
| min_valueopt | INT | 0-2147483647–2147483647 | — |
| max_valueopt | INT | 10-2147483647–2147483647 | — |
| display_nameopt | STRING | — | |
| descriptionopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| value | INT | — |