ComfyUI Node

Slider

A draggable number widget that can output INT or FLOAT

By Smirnov75·Created 2 years ago·Updated about a year ago· 315
Slider
    • X
    Xi20
    Xf20.00
    isfloatX0

    ComfyUI's default number widgets are plain text boxes with tiny up/down arrows - fine for a value you set once and forget, annoying for anything you want to nudge around while you compare results. mxSlider is a proper drag-to-set slider that lives as its own node, and the neat part is it can hand you either a whole number or a decimal depending on how you configure it, so it isn't locked to one kind of numeric input.

    Why you'd reach for it

    Anywhere in a graph that wants a bare number - denoise strength, CFG, an upscale multiplier, a batch count, some custom node's numeric input you'd otherwise be fat-fingering into a text box - mxSlider gives you a compact control with a defined range and step you can drag through instead of typing. That's the whole pitch: it's not doing anything a number widget can't do, it's doing it faster when you're iterating.

    How it works

    The behavior is all described in the widget itself, and it's worth knowing before you go hunting for a settings panel:

    • decimals set to 0 makes the output a whole number (INT); anything above 0 makes it a FLOAT. This is the switch that decides which "mode" you're in.
    • step sets how much the value moves per notch, and snap locks the value to that step grid. Holding shift while dragging flips whatever snap is currently set to.
    • Holding Ctrl while dragging lets you push the value outside the configured min/max, for the rare case you need to.
    • Double-click the value to type a number in directly instead of dragging.

    The inputs and output that matter

    The node's underlying schema exposes three required fields, and they map onto that widget behavior even if you never touch them directly in the UI:

    • Xi - an INT, default 20. The integer copy of your value.
    • Xf - a FLOAT, default 20. The decimal copy of the same value.
    • isfloatX - a 0/1 switch. This is what actually decides which of the two above gets sent to the output: 0 routes Xi (your INT), 1 routes Xf (your FLOAT). It's the execution-level counterpart to the decimals setting on the widget - zero the decimals and you're reading the int path, raise them and you're reading the float path.

    There's a single output, X, typed as a wildcard (*). Because it's untyped, ComfyUI will let you wire it into essentially any numeric input socket - but the value itself is only as valid as whatever mode you left the slider in. Wire a float-mode X into a socket that strictly wants an INT and you can get a mismatch; the fix is just setting decimals to 0 upstream so the slider is genuinely handing out whole numbers.

    Installing it

    Through ComfyUI Manager: search ComfyUI-mxToolkit (or mxToolkit), install, restart. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Smirnov75/ComfyUI-mxToolkit
    

    Restart after. This is one of five nodes the pack ships (alongside Seed, Stop, Slider2D, and an alternative Reroute) - one install gets you all of them, under utils/mxToolkit in the node browser. No models, no extra Python dependencies called out in the README; it's a lightweight UI/graph pack, not anything inference-related.

    Common issues

    The interactive bits - dragging, shift-to-invert-snap, Ctrl-to-exceed-range, double-click-to-type - are all mouse and keyboard gestures on the canvas widget. None of that fires if you're calling this workflow through the API rather than clicking around in the browser. At the API level you're just setting Xi, Xf, and isfloatX directly, and you get back whichever of Xi/Xf the isfloatX flag points at - which is honestly simpler, you just need to remember there are two value fields and a mode flag instead of one plain number.

    The other thing to watch: if a downstream node insists on an integer and your output looks "off" (extra decimals, or a value that doesn't round the way you expect), check isfloatX/decimals before assuming the slider is broken - it's almost always still in float mode.

    Categoryutils/mxToolkit

    Inputs (3)

    NameTypeDefaultDescription
    XiINT20-4294967296–4294967296
    XfFLOAT20.00-4294967296–4294967296
    isfloatXINT00–1

    Outputs (1)

    NameTypeDescription
    X*