Nodes/ComfyUI WorkspaceKit/WK Float Generator
ComfyUI Node

WK Float Generator

One float you set once, and a randomize that fires *before* the run

By ZiYao00·Created 4 months ago·Updated 17 days ago· 5
WK Float Generator
    • float
    • string
    ◄value0.0►
    ◄min_value-4.0►
    ◄max_value2.0►
    ◄step0.1►
    ◄decimal_places1►

    What it's actually for

    Roughly 70% of any ComfyUI workflow is plumbing, and the base problem plumbing solves is repetition. You have a LoRA strength of 0.8, and it needs to feed the LoRA loader, a note, and the filename you save under. Type it in three places and you will forget one - usually the third, silently, three hours into a batch.

    That's what WK Float Generator is: one typed number, output twice, ready to fan out. Float in, float out, plus a text version of the same number so you can print it somewhere. Nothing about it touches pixels, and that's the point.

    It ships inside ComfyUI WorkspaceKit - a workspace/sidebar plugin for ComfyUI by ZiYao00, currently public beta - as one of a small family of utility nodes under 🧩 WorkspaceKit/Utilities. Expect the full sidebar plugin when you install it, not just this node.

    How it works

    The backend half is a clamped converter. You give it value, min_value, max_value, step and decimal_places; it clamps the value into range and returns it as a FLOAT and as a STRING formatted to exactly decimal_places digits - so 0.3 with one decimal place comes back as the text "0.3". It rounds to your precision and refuses to guess: feed it a value with more decimals than decimal_places allows and it raises "Value exceeds the selected decimal precision" rather than quietly truncating. Same for min_value > max_value and a step of zero.

    The interesting half is the widget. There's a combo box labelled control before generate, dropped in right below value, defaulting to randomize, with fixed, increment, decrement and randomize as the modes. It is not the standard control_after_generate - and the difference matters. The KB has the whole saga of the standard control: it fires after a run, so the seed sitting in the box is the one that will be used next, not the one that produced the image you're looking at, and the standard cure is to set ComfyUI's global "widget control mode" to Before once per install.

    This node does that per-node. Its control hooks ComfyUI's beforeQueued, so the value in the box is updated before the prompt is dispatched, and what's displayed is what actually ran. Two deliberate exceptions: it won't advance on a partial queue (so it can't move nodes that aren't part of the run), and it does nothing at all if value is a linked input - a wire owns the value, the widget doesn't.

    The randomizer isn't random.uniform. It draws from the values representable at your chosen precision between the two bounds, and both bounds are included. step only applies to increment and decrement, and those stop at the bound instead of wrapping around.

    The inputs and outputs you'll touch

    • value - the number. Everything else is guardrails.
    • min_value / max_value - the clamp and the randomization range. Defaults are -4 to 2, which is a slider range wearing a float costume; set them to whatever you're actually varying.
    • step / decimal_places - how far increment/decrement moves, and how many digits make it into the string output.

    Outputs are float and string. Send float into anything expecting a FLOAT once you've right-clicked that widget and converted it to an input. Send string into a text field - a filename_prefix, a note node, a prompt stamp - so the number ends up written on the artifact instead of living only in a widget you'll overwrite next run.

    Note the mode itself is not serialized into the workflow (the widget is declared serialize: false). Treat it as per-session state. If you want to hand someone a fixed workflow, tell them.

    Install

    ComfyUI Manager: search WorkspaceKit (or comfyui-workspacekit), install, restart. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ZiYao00/ComfyUI-WorkspaceKit.git
    cd ComfyUI-WorkspaceKit
    python -m pip install -r requirements.txt
    

    Windows portable, from the ComfyUI root:

    .\python_embeded\python.exe -m pip install -r .\ComfyUI\custom_nodes\ComfyUI-WorkspaceKit\requirements.txt
    

    That requirements.txt is one line - send2trash, for the panel's trash integration. No model files, no downloads. Restart ComfyUI after installing; the pack ships frontend JavaScript, and the number-generator widget only exists once the browser extension loads.

    Where it bites

    • Nothing randomizes. Either value is a converted-to-input socket with a wire on it, or you queued only part of the graph.
    • It keeps changing on its own. That's randomize being the default and the control not being saved. Set it to fixed after you load a workflow you intend to reproduce.
    • You can't find it. It's under 🧩 WorkspaceKit/Utilities in the node search - search WK Float.
    • Beta, and honest about it. The README asks you to back up workflows and settings before running it in a production install, and warns that issue replies may lag by a couple of weeks. The utility nodes are the boring, stable end of the pack, but that's the surrounding context.
    Category🧩 WorkspaceKit/Utilities

    Inputs (5)

    NameTypeDefaultDescription
    valueFLOAT0.0-1000000–1000000—
    min_valueFLOAT-4.0-1000000–1000000—
    max_valueFLOAT2.0-1000000–1000000—
    stepFLOAT0.10.000001–1000000—
    decimal_placesINT11–6—

    Outputs (2)

    NameTypeDescription
    floatFLOAT—
    stringSTRING—