Nodes/h4_Live/h4 - Traffic Router
ComfyUI Node

h4 - Traffic Router

The one node that makes 'loop until it's good' actually work

By m3rr·Created 9 months ago·Updated 11 days ago· 1
h4 - Traffic Router
  • first_run_in
  • loop_run_in
  • Context_Out
  • Denoise_Val
â—„first_denoise1.00â–ş
â—„loop_denoise0.45â–ş
â—„restartfalseâ–ş

H4_TrafficRouter is the node the h4_Live pack is really selling - the one the README calls "The Nexus." It's the Traffic Cop splitter and the Traffic Merge zipper fused into a single node, with denoise control built in. Wire your "first run" data into one input, your "loop" data into the other, and it hands your KSampler a single stream: run 0 gets the fresh start (denoise 1.0), runs 1+ get the feedback data (denoise ~0.45). Same graph, two behaviors, zero manual switching between queue presses.

The pitch in the README is the whole point of the pack: "First pass, do the heavy work. Then loop, refine, and improve it a few times." If you want to run a grid, refine a result in place, or evolve an image over several passes, this is the node that makes that feel deliberate instead of hacky.

How it works

Same engine as all h4 traffic nodes: a global in-memory counter that increments each run. The Router reads it, routes accordingly, and - the neat part - uses lazy evaluation to only pull the input it actually needs for the current run. On run 0 it only requests first_run_in; on runs 1+ it only requests loop_run_in. So your "loop" branch doesn't even execute on the first pass, which keeps a loop workflow from doing wasted work. It also means it's picky: if it's on run 0 and first_run_in is missing, it raises a clear "I cannot start without it" error rather than silently routing nothing.

  • restart (boolean, default OFF) - OFF keeps the counter incrementing (looping). ON resets to run 0.
  • first_denoise (float, default 1.0) - sent on run 0.
  • loop_denoise (float, default 0.45) - sent on runs 1+.
  • first_run_in (*) - data for run 0, e.g. an empty latent.
  • loop_run_in (*) - data for runs 1+, e.g. a buffered latent from the previous pass (see the wireless buffer pattern from H4_TrafficMerge).

Outputs: Context_Out (*) - wire to your KSampler's latent/input - and Denoise_Val (float) - wire to the sampler's denoise. The node's own description spells out exactly this wiring.

Installing h4_Live

Part of the h4_Live pack. ComfyUI Manager: search h4_Live, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/m3rr/h4_Live

Restart. No model downloads, no extra pip packages. Be aware this is a single-developer, actively-developed pack with almost no community history yet - the loop mechanic here is real and usable, but it's young software, and the pack's own example (02_The_Nexus_TrafficRouter) is the clearest guide.

Common issues

  • Understand what "loop" means here. ComfyUI can't actually cycle - the graph is a one-way DAG. The Router's loop is run-count state: you press Queue, the counter advances, and the node re-routes. To feed the previous result back in, you need the wireless image buffer (H4_ImageBuffer), exactly like TrafficMerge. Wire the loop directly and you hit a Cycle Error.
  • The error messages are your friend but loud. Missing first_run_in on run 0 throws hard - that's correct behavior, but it's easy to misread as a broken node. It's telling you the start data isn't connected.
  • One shared counter. The whole h4 traffic family reads one global counter. Two Router/Merge/Cop loops in one workflow fight over it. One loop per workflow, or use the restart toggles deliberately.
  • Restart timing. Toggling restart mid-loop resets the count but the reset only takes effect on the next execution - use the State Monitor to verify the count is actually where you think it is.
Categoryh4_Live/Logic

Inputs (5)

NameTypeDefaultDescription
first_denoiseFLOAT1.000–1Denoise value to send during the start (Run 0).
loop_denoiseFLOAT0.450–1Denoise value to send during the loop (Run 1+).
restartBOOLEANfalseTrue = Reset to 0. False = Continue Looping.
first_run_inopt*Items for the FIRST run (Run 0).
loop_run_inopt*Items for the LOOP runs (Run 1+).

Outputs (2)

NameTypeDescription
Context_Out*—
Denoise_ValFLOAT—