Nodes/ComfyUI-Distributed/Distributed Value
ComfyUI Node

Distributed Value

Give each worker its own prompt, model, or setting

By robertvoy·Created about a year ago·Updated 29 days ago· 582
Distributed Value
    • value
    default_value
    worker_values{}

    Distributed Value is the node you reach for when "run the same workflow on every GPU" isn't enough and you want each worker doing something different. Distributed Seed already varies the seed per worker; Distributed Value generalizes that idea to any value - a different prompt on card 1, a different model on card 2, a different CFG on card 3. One run, one graph, but each participant fed its own override.

    That makes it the power-user node of the pack. Most parallel workflows just want N variations of one thing, and the seed node covers that. This is for when you deliberately want a spread: four prompts explored at once, or two checkpoints compared side by side, in a single distributed pass.

    How it works

    The mechanism is a default plus a per-worker override map. You set a default_value, and separately a mapping of specific values keyed to specific workers. At execution the master uses the default, and each worker looks itself up in the map and uses its own override if it has one - falling back to the default (with type coercion) if it doesn't. So the master and any un-mapped worker all run the default, while mapped workers each get their bespoke value.

    The clever part is the typing. The output adapts to whatever you connect it to, where possible - STRING, INT, FLOAT, or a COMBO (dropdown) value. Plug it into a prompt's text input and it behaves as text; plug it into a CFG field and it coerces to a number. The node also tracks your workers live: it only shows currently-enabled workers, and if you toggle workers on or off, the per-worker fields update themselves to match. Disconnect the output and it resets to plain string mode and clears the overrides, so you start clean.

    The inputs and outputs

    • default_value (STRING, default empty) - the value the master and any unmapped worker use. Even though it's stored as a string, it gets coerced to whatever type the connection needs.
    • worker_values (STRING, default {}) - the per-worker override map, held as JSON. In practice you drive this through the node's UI fields (one per enabled worker) rather than hand-editing JSON, but under the hood it's this {} map - worth knowing when a value doesn't take, because a malformed map is the reason.

    The single output is value, typed * (wildcard) so it can adapt to its destination. Wire it into whatever input you want to vary across workers - a CLIP Text Encode, a model-name field, a sampler setting.

    Installing it

    It's in the ComfyUI-Distributed pack. ComfyUI Manager: search ComfyUI-Distributed, install, restart. Terminal: cd ComfyUI/custom_nodes && git clone https://github.com/robertvoy/ComfyUI-Distributed.git, then restart ComfyUI. No model downloads or heavy dependencies; the pack's real prerequisite is multiple GPUs (or cloud workers), and remote/cloud workers want --enable-cors-header on the master.

    Where people get burned

    • Connect first, configure second. The node keys its behavior off what it's wired into and which workers are enabled. Disconnecting resets it to string mode and wipes the overrides, so set up the connection and your worker set, then fill in the values - not the other way round.
    • Overrides vanish after toggling workers. Because it only shows enabled workers and rebuilds its fields when the set changes, reshuffling which workers are active can leave you re-entering overrides. Settle your worker lineup before assigning per-worker values.
    • Type mismatches. The coercion is good but not magical. Feed a non-numeric string into something that needs a float and it falls back to the default rather than doing what you meant. Match the value to the destination's type.
    • Overkill for simple variety. If all you want is different seeds, use Distributed Seed - it's simpler and purpose-built. Distributed Value is for genuinely different inputs per worker, and it's more moving parts than a basic "four images at once" run needs.
    Categoryutils

    Inputs (2)

    NameTypeDefaultDescription
    default_valueSTRING
    worker_valuesSTRING{}

    Outputs (1)

    NameTypeDescription
    value*