Set Widget Value
Write into another node's widget mid-run
- signal
- signal_opt
Set Widget Value reaches into another node while the graph is running and overwrites one of its widgets - a seed, a step count, a denoise, a string field. You name the target node, name the widget, hand it the new value, and it writes it. It's the "poke a knob from inside the workflow" node, and like the rest of Impact Pack's experimental logic nodes, it makes sense only once you know it's for building loops.
Here's the setup it belongs to. ComfyUI runs a graph once and stops. Impact Pack's logic nodes let you fake iteration: the workflow re-queues itself, and on each pass something has to change, or you're just rendering the same frame forever. Set Widget Value is the thing that changes. It's how the loop advances its own counter, bumps a seed, walks a denoise value down over several passes, or rewrites a prompt between iterations. Without it, a loop repeats identically; with it, a loop can march.
What it takes
signal is a wildcard passthrough - anything in, same thing out as signal_opt. You don't use it for data; you use it to control when this node fires, because in a graph with no data dependency there's no other way to force ordering. node_id is the numeric ID of the node you're writing to, which you read off the target after turning on ID badges in ComfyUI-Manager (the Badge: #ID Nickname display). widget_name is a string - the exact name of the widget you want to overwrite on that node.
Then you pick the value, and this is where the node gets its shape: it has four optional value inputs - boolean_value, int_value, float_value, and string_value. You connect the one that matches the widget's type. Writing a new seed? Use int_value. A denoise? float_value. A prompt? string_value. The pack's own docs are blunt that if the types don't match, you get an error - so a float into an int widget, or a string into a numeric one, will fail. Match the value type to the widget type and it writes cleanly.
The rule that saves you
This is an output node, and there is one discipline that matters more than everything else combined: run it at the very end of the workflow. Impact Pack states it directly - state-changing nodes like Set Widget Value, Set Mute State, and Queue Trigger should execute last. The reason is obvious once you say it: if you rewrite a KSampler's seed before that KSampler runs, you've changed this pass, not the next one. The intent is almost always to set up the next iteration, so the write has to land after everything in the current pass has finished reading its widgets.
You enforce that ordering with the signal input - chain it off your final output node so Set Widget Value is provably last in line.
Where it bites
Two documented traps. First, batch count above 1 breaks the loop machinery; keep it at 1 and drive repetition through the queue. Second, if you're advancing a seed, do it here rather than with the node's own randomize toggle - the pack specifically warns that seed randomization and this node fighting over the same widget causes trouble, and that any seed change should happen at the workflow's tail, through Set Widget Value, not via a random-generate that fires mid-graph.
Frankly, this is advanced, sparsely-documented territory - the category is literally named _for_test. Most people never need it. If you just want a value defined once and reused, use a normal input node. Set Widget Value is for the specific case where the workflow must rewrite its own knobs between automated passes.
Installing it
It's bundled with ComfyUI Impact Pack. Install the pack via ComfyUI-Manager (search ComfyUI Impact Pack, Install, restart), or manually: cd ComfyUI/custom_nodes && git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack, install its requirements.txt into ComfyUI's Python environment (portable: ..\..\..\python_embeded\python.exe -m pip install -r requirements.txt), restart. Auto-install ended in v7.6, so a bare manual clone needs the requirements step to load. The pack is ltdrdata's, maintained alongside ComfyUI-Manager - very stable - though these loop nodes are its experimental corner, so expect some trial and error wiring them.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| signal | * | — | |
| node_id | INT | 00–18446744073709550000 | — |
| widget_name | STRING | — | |
| boolean_valueopt | BOOLEAN | — | |
| int_valueopt | INT | — | |
| float_valueopt | FLOAT | — | |
| string_valueopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| signal_opt | * | — |