Nodes/SDVN_Comfy_node/πŸ“Š Int Slider
ComfyUI Node

πŸ“Š Int Slider

A drag-to-set integer input for ComfyUI

By StableDiffusionVNΒ·Created 2 years agoΒ·Updated about a month agoΒ· 118
πŸ“Š Int Slider
    • int
    β—„num0β–Ί
    β—„settings{"min": 0, "max": 100, "step": 1}β–Ί

    It's a slider that spits out an integer. That's genuinely all it is, and that's fine - sometimes you just want to grab a value and drag it instead of clicking into a number box and typing. Wire the output into any INT input - steps, a batch count, a width or height, a seed offset, whatever - and now you've got a physical dial for it on the canvas.

    Where this earns its place is prototyping and live tweaking. When you're dialing in a workflow and want to sweep a value while watching the result, a slider you can nudge with the mouse beats typing 24, running, typing 28, running. It's a small quality-of-life thing, not a capability you didn't have - core ComfyUI already lets you type integers everywhere. But the SDVN pack is full of these little ergonomic widgets, and if you build a lot of graphs they add up.

    How it works

    The node exposes a slider bound to an integer range and outputs whatever it's currently set to as a plain INT. Downstream, that value behaves exactly like any hand-typed integer - ComfyUI doesn't know or care that it came from a slider.

    The neat trick is the settings field, which lets you redefine the slider's range without touching the node's code. By default the slider runs 0–100 in steps of 1, which is fine for a lot of things and useless for others (you're not setting a 30-step count on a 0–100 dial with much precision). The settings input lets you rescale it to whatever you actually need.

    The inputs that matter

    • num - the value itself, the thing the slider sets. Defaults to 0, and out of the box the range is 0 to 100 in steps of 1.
    • settings - an optional JSON string that overrides the slider's bounds. The default is literally {"min": 0, "max": 100, "step": 1}, and you edit those numbers to reshape the dial. Want a 1–50 slider for sampler steps? {"min": 1, "max": 50, "step": 1}. Want to coarse-tune in tens? Bump step.

    The single output is int - an INT you plug into any integer socket.

    Common issues

    The slider ignores my custom range. The settings field is JSON, and it's fussy about it. A missing quote, a trailing comma, single quotes instead of double - any of those and it can't parse, so it falls back to the default 0–100. Copy the default string, change only the numbers, and keep the double quotes.

    My value snaps to weird numbers. That's step doing its job. If step is 5, the slider can only land on multiples of 5. Set step to 1 for fine control.

    It's an integer, so no decimals. Obvious once said, but if you need a fractional value this is the wrong node - SDVN ships separate float slider widgets for that. This one rounds to whole numbers by design.

    Installing SDVN_Comfy_node

    ComfyUI Manager: search "SDVN_Comfy_node" β†’ install β†’ restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node
    

    Then pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt from your ComfyUI root and restart. You'll find it under πŸ“‚ SDVN / πŸ’‘ Creative. No models or heavy dependencies for this one - it's pure UI.

    CategoryπŸ“‚ SDVN/πŸ’‘ Creative

    Inputs (2)

    NameTypeDefaultDescription
    numINT00–100β€”
    settingsoptSTRING{"min": 0, "max": 100, "step": 1}Slider configuration used by popup (JSON).

    Outputs (1)

    NameTypeDescription
    intINTβ€”