ComfyUI Node

%

Turn a 0–100 integer into a 0–1 float

By GizmoR13·Created 11 months ago·Updated 11 months ago· 16
%
    • float
    value

    Percent is exactly as minimal as it looks: feed it an integer, get that integer divided by 100 back as a float. 42 in, 0.42 out. The node's display name is literally "%", which tells you everything about its ambitions.

    It exists to bridge the ComfyUI habit of thinking in percentages with the sampling internals that think in 0-to-1 proportions. Lots of nodes ask for a float like 0.5 meaning "half"; a lot of workflows were built by people who'd rather type 50. This is the translator. It also happens to be handy when a knob is wired to an integer widget upstream - some converters feed other nodes integers, and a plain divide-by-100 is the cheapest way to normalize.

    How it works

    There's a value input, typed INT, marked forceInput - meaning you usually feed it from another node rather than typing into it. The node's process() does float(value) / 100.0 and returns a single FLOAT named float. That's the whole mechanism. It's stateless, cache-friendly, and has no side effects; the only change-detection logic is so ComfyUI re-evaluates when the input integer changes.

    Where does this actually get used? Two classic spots:

    • Percent-based strength sliders. If you're building a panel of "strength 0–100" controls and your target node wants 0–1, route the integer through here once instead of hand-converting.
    • Progress/swap thresholds. Combined with a node that takes a 0–1 trigger point - like the pack's own Swap CFG Guidance (which takes swap_percent as a 0–1 float) - you can keep the user-facing number in percent and convert at the wire.

    The input and output

    • value - an INT, force-fed from upstream. 100 → 1.0, 50 → 0.5, 10 → 0.1.
    • Output: float (FLOAT), the value divided by 100.

    Non-integer input would be coerced, but the type contract is INT, so don't wire a FLOAT into it and expect precision - that's what a math node is for.

    Install

    Ships with PG Nodes:

    ComfyUI Manager → search "PG Nodes" → Install → restart
    

    Manual clone: https://github.com/GizmoR13/PG-Nodes into custom_nodes (folder named PG-nodes), restart. It sits under PG/Utils. Zero dependencies.

    Common issues

    • It doesn't accept typed decimals. The input is INT, so a 50.5 would be truncated if forced. If you need real percentages with decimals, use a standard math/float node instead.
    • "Why is my 100 turning into 1.0 and my workflow broke?" That's the intended behavior - check what the downstream node expects. If it wanted a percentage, this node is in the wrong place.

    Honestly? You could skip this node and do the division in a Math node from a hundred other packs. But if you're already running PG Nodes and you want the one-widget, self-documenting version, it does the job without ceremony. Sometimes the right tool is the boring one.

    CategoryPG/Utils

    Inputs (1)

    NameTypeDefaultDescription
    valueINT

    Outputs (1)

    NameTypeDescription
    floatFLOAT