Nodes/ComfyUI-xiaozhuguang/小珠光万能滑条
ComfyUI Node

小珠光万能滑条

One slider, float or int — switch types with a right-click

By xiaozhuguang·Created 2 months ago·Updated a day ago· 56
小珠光万能滑条
    • output
    value0.50

    The unglamorous backbone of every "tweak this by feel" workflow is a slider, and ComfyUI's primitives are surprisingly stiff about them: an INT widget wants integers, a FLOAT widget wants floats, and neither is pleasant to drag when you want 0.37 of something. XiaozhuguangUniversalSlider (小珠光万能滑条 - "universal slider") is the pack's answer to that friction: one slider widget with a huge range, and a right-click on the node toggles the output between float and int. Same control, two types, no second node.

    The mechanism is a one-liner with a type switch. The backend takes the value input (a FLOAT with a default of 0.5 and a range from -999,999 to 999,999 - deliberately enormous so you don't hit the rails) and returns it. The trick is the hidden output_type parameter: when it's set to int, the node rounds the value and emits an integer; when float, it emits the float. The frontend wires right-click on the node to flip that flag, so switching types is a gesture, not a hunt through settings. Because the output port is any-type (*), it connects to whatever downstream input needs the number - float or int - and the connection keeps working after a type switch.

    Inputs and outputs:

    • value - the slider's current value (FLOAT, default 0.5, step 0.01).
    • output - the value, as float or int depending on the toggle.

    That's the whole thing. The useful consequence of the huge range is that one node covers denoise values (0–1), CFG (up in the tens), steps (small ints), and even a rough seed if you're in a pinch - you don't rebuild a slider for every scale. In practice this is the "control panel" node of the pack: pair it with the selector and boolean nodes and you've got a strip of clickable, draggable controls at the top of a workflow.

    Two honest notes. First, don't confuse it with a fixed-range parameter slider: there's no min/max on the node itself, so precision drags on a 0–1 value are worse than a dedicated small-range slider - you're dragging across two million units of range. For fine control of small ranges, a purpose-built node wins. Second, the float output is rounded to ten decimal places before leaving, which you'll never notice but which keeps the graph's serialized values stable across saves. There's also a plain "滑条" (slider) variant in the pack if you want the non-universal, always-float version.

    Install: ComfyUI Manager → ComfyUI-xiaozhuguang → restart, or git clone into custom_nodes. No models, no dependencies. It's a tiny convenience that quietly makes tweaking-by-hand less annoying - which, if you spend your evenings staring at a canvas nudging CFG up and down, is more than it sounds like.

    Categoryxiaozhuguang

    Inputs (1)

    NameTypeDefaultDescription
    valueFLOAT0.50-999999–999999

    Outputs (1)

    NameTypeDescription
    output*