Nodes/ComfyUI-Flow-Control/Flow - Latent Condition
ComfyUI Node

Flow - Latent Condition

Fan one latent out to your conditional branches

By krich-cto·Created 2 years ago·Updated 2 years ago· 1
Flow - Latent Condition
  • latent
  • gate_1
  • gate_2
  • gate_3
  • gate_4
  • gate_5
  • gate_6
  • gate_7
  • gate_8
  • gate_9
gates

FlowLatentCondition is the splitter for the latent side of a Flow graph - the sibling of FlowImageCondition, but instead of fanning an image out to your branches, it fans a latent out. Same gate system, same pruning, different data type. You use it when you want to branch before the VAE: take one latent, split into up to nine gate-named outputs, and let the pack's flow logic keep only the branch you selected.

It pairs with FlowLatentAutoBatch, which collects the surviving branches back into one latent batch. Together they let you build a "choose your own post-processing" graph that runs in latent space.

How it works

Inputs are latent and gates (a STRING with forceInput, so it must be connected to a FlowGate rather than typed). The node splits the gate string on commas and returns a copy of the latent on gate_1 through gate_9 - one output per gate value.

The frontend renames those outputs to match your gate names when a FlowGate is connected, and adds the selector (a dropdown for Single mode, toggles for Multiple) that decides which gates are open. At execution the pack's patched prompt validation reads that selector and deletes every node downstream of the closed outputs, recursively. Only the open branch's pipeline survives to the sampler.

The inputs that matter

  • latent - the latent to fan out, typically from an Empty Latent or an encode.
  • gates - the comma-joined gate string from FlowGate. Connect, don't type.

Outputs: gate_1gate_9, each a copy of the input latent, renamed to your gate names. Wire each into a distinct latent-space pipeline (different samplers, different denoise, different ControlNet paths).

Install

Part of ComfyUI-Flow-Control:

cd ComfyUI/custom_nodes
git clone https://github.com/krich-cto/ComfyUI-Flow-Control

Restart ComfyUI, or Manager → "ComfyUI-Flow-Control".

Gotchas

Same house rules as the other condition nodes: closed branches are deleted from the executed prompt, so a mis-set gate silently kills half the graph rather than erroring. An empty gates string produces zero outputs, so the FlowGate connection is mandatory, not cosmetic. And every output carries the same latent - all per-branch variety has to come from the nodes downstream of each gate. If your branches need to start from different latents, this isn't the right tool; it's specifically "one latent, many routes."

CategoryFlow/begin-conditions

Inputs (2)

NameTypeDefaultDescription
latentLATENT
gatesSTRING

Outputs (9)

NameTypeDescription
gate_1LATENT
gate_2LATENT
gate_3LATENT
gate_4LATENT
gate_5LATENT
gate_6LATENT
gate_7LATENT
gate_8LATENT
gate_9LATENT