Nodes/ComfyUI-MAINodes/H3 Mode Switch (preview / final, lazy)
ComfyUI Node

H3 Mode Switch (preview / final, lazy)

One graph, two pipelines, a dropdown that only runs the branch you picked

By matlowai·Created 17 days ago·Updated about 18 hours ago· 112
H3 Mode Switch (preview / final, lazy)
  • preview
  • final
  • *
modepreview

Pure plumbing, and honestly the node that makes the pack's recommended workflow usable. The stated way to work with ComfyUI-MAINodes is: iterate prompts and seeds on a fast turbo preview, and run only the winner through the full pipeline - mixing them is a waste of time. H3 Mode Switch is what lets both live in one workflow. A mode dropdown picks preview or final, and the important part is the word lazy: only the selected branch actually executes.

How it works

This is an A/B switch with a lazy twist. In the brief's words, it "routes one of two inputs through, and only the selected branch executes (lazy evaluation)." That's not just a semantic nicety - lazy inputs in ComfyUI mean the engine doesn't even evaluate the other branch's upstream nodes. Wire a fast turbo preview path into preview and the full pipeline into final, and when mode is preview, the whole expensive final branch is dead weight on the canvas that never runs. Switch to final and the preview path goes cold instead.

Inputs and outputs are dead simple:

  • mode - enum, preview or final, default preview.
  • preview / final - any-type inputs. Wire matching pairs: VIDEO to VIDEO, IMAGE to IMAGE, whatever you're toggling.
  • Output - one any-type output that passes the selected branch through.

Because both sockets are * (the wildcard type), it doesn't care what you're switching. It's the same lazy-switch pattern rgthree and others popularized, distilled to two options with a purpose-built name.

Why you'd reach for it

The pack's own "intended end state" is a unified workflow with a preview/final toggle, and this is it. Keep your prompt and seed wiring in one place, flip mode while iterating, flip it back when the keeper's ready. It also keeps the graph readable: one canonical graph instead of two nearly-identical saved files that drift apart the moment you edit one and forget the other.

Install

Ships with ComfyUI-MAINodes:

cd ComfyUI/custom_nodes
git clone https://github.com/matlowai/ComfyUI-MAINodes

or search ComfyUI-MAINodes in ComfyUI Manager and restart. It sits under utils/minimax. No dependencies, no models.

Common gotchas

The one real trap is wiring mismatched types - VIDEO into one input and IMAGE into the other works mechanically (it's *), but the output then can't satisfy whatever you've wired downstream, and ComfyUI will error at validation. Keep the pair the same type. And remember the branch you're not using genuinely doesn't run: if you expected to see both results in one queue, you'll get only the selected one. That's the feature.

Categoryutils/minimax

Inputs (3)

NameTypeDefaultDescription
modeCOMBOpreview2 options: preview, final
previewopt*
finalopt*

Outputs (1)

NameTypeDescription
**