Nodes/PortraitUtils/Active Editor Target
ComfyUI Node

Active Editor Target

The one wire that says which editor is actually running

By heyburns·Created about a year ago·Updated 23 days ago· 3
Active Editor Target
  • target_1
  • target_2
  • target_3
  • target_4
  • active_target
  • target_name
◄fallback_targetDirect / No Editor►

What it's for

Modern photo workflows tend to keep two or three instruction editors installed at once - Qwen Image 2.1, FireRed Image Edit 1.1, Flux 2 Klein Base - because they're good at different things and you don't want to rewire a graph to switch between them. So you keep them in separate groups and mute all but one.

That works until something downstream has to know which one ran. Preparation needs to pick a resolution tier and alignment for a specific model. The result gate needs to know which decoded image to read. Rather than dragging a string widget around and hoping you updated it, this node resolves the answer from the graph's own state: one wire, and it's always right about which group is live.

How it works

Editor Target Beacon nodes sit inside each editor's group and emit a PORTRAIT_EDITOR_TARGET token. Connect up to four of them to target_1…target_4. When a group is muted, its beacon doesn't execute and its wire arrives empty; ComfyUI's optional inputs read None, so the node simply walks the four and collects the live ones.

  • Exactly one live beacon → that's the target.
  • Zero live beacons → fallback_target, which defaults to Direct / No Editor.
  • More than one live beacon → it raises an error naming the fix: configure your group muter so exactly one editor group is active.

That last case is the whole design. A silent "first one wins" would quietly run the wrong editor or the wrong resolution tier, and you'd only notice from a slightly soft result. Here it stops.

Outputs: active_target, which wires into Smart Photo Prepare and Editor Result Gate, and target_name as a STRING - handy for a text-preview node or a Note if you want to see at a glance which path fired.

Wiring it

Keep it outside the mutually exclusive groups. Inside them, it'd be the first thing to disappear when you mute a group.

Qwen group         [Editor Target Beacon: Qwen Image Edit 2.1] ---\
FireRed group      [Editor Target Beacon: FireRed Image Edit 1.1] --\
Klein group        [Editor Target Beacon: Flux 2 Klein Base] --------\
                                                                     > Active Editor Target
                                                                       |           |
                                                          Smart Photo Prepare    Editor Result Gate

rgthree's Fast Groups Muter is the usual driver, and the suite's docs suggest giving your editor groups a dedicated muter with the "always one" restriction rather than applying that restriction to a muter that also controls cropping, upscaling and saving. Fair advice - "always one" on a shared muter means you can't turn everything off for a sanity check.

Beacons default to Qwen Image Edit 2.1, so set each one explicitly. If you're porting an old 1.x workflow, the retired Qwen 2511 and Kontext labels don't exist any more, and the gate's old qwen_image socket has no alias.

What it is not

It does not route pixels. It selects a model profile. The image routing happens in Editor Result Gate, which takes this target plus the decoded outputs. People wire this node expecting it to pass an image through and then wonder where the picture went. If you want the graph shape properly, that's Beacon → Active Editor Target → (Prepare + Gate), and Gate → upscaler.

Also worth knowing before you start: four inputs is the cap. A fifth editor group means a different setup, not a fifth socket.

Install

ComfyUI Manager → search PortraitUtils (publisher heyburns, GPLv3):

cd ComfyUI/custom_nodes
git clone https://github.com/heyburns/PortraitUtils
/path/to/ComfyUI/venv/bin/python -m pip install -r PortraitUtils/requirements.txt

Restart the server, refresh the browser. The suite needs Python 3.10+ and pulls numpy, Pillow, opencv-python-headless and tifffile; the editors themselves are separate installations. Nothing in PortraitUtils downloads model weights for you.

Where people get burned

Muting an editor group but leaving its beacon wired somewhere else will make this node see two live targets and error - which is the intended behaviour, not a bug. And a Direct / No Editor fallback plus allow_direct off on the gate is a deliberate trap: the run fails loudly rather than silently saving an unedited photo. Turn allow_direct on only when you actually meant it.

CategoryPortraitUtils/Photo Edit

Inputs (5)

NameTypeDefaultDescription
fallback_targetCOMBODirect / No EditorUsed only when every connected editor beacon is muted.
target_1optPORTRAIT_EDITOR_TARGET—
target_2optPORTRAIT_EDITOR_TARGET—
target_3optPORTRAIT_EDITOR_TARGET—
target_4optPORTRAIT_EDITOR_TARGET—

Outputs (2)

NameTypeDescription
active_targetPORTRAIT_EDITOR_TARGET—
target_nameSTRING—