Nodes/Photoshop Bridge/Annotate for Edit
ComfyUI Node

Annotate for Edit

The annotation node Kontext and Qwen-Image-Edit workflows have been missing

By ericpaulsnowden·Created 2 months ago·Updated 4 days ago· 1
Annotate for Edit
  • image
  • mask
  • image
  • mask
  • instruction
  • annotated
instruction
modePass through
box_compositefalse
timeout_seconds1800

Modern instruction-editing models like Kontext and Qwen-Image-Edit want two things: a typed instruction ("change the shirt to red") and a mask or box marking where it applies. Building those by hand means either painting masks in the graph or literally drawing red boxes onto your image pixels, which is fiddly and easy to get wrong. Annotate for Edit is the node that pairs those two inputs for you - and in its default mode it does it without touching Photoshop at all.

Pass through mode first

The default mode is Pass through, and it's the mode most people should start with: the node reads your connected mask input (or hands back an empty mask when nothing's connected), passes the image through unchanged, and spits out the four things an edit workflow needs:

  • image - the resolved image, unchanged.
  • mask - the marked region (1.0 = marked). Your connected mask, in this mode.
  • instruction - your text, verbatim. The node never draws text onto pixels; it's a pure pass-through.
  • annotated - the image with the annotation visible. With box_composite on, that's a tidy red box at the mask's bounding box - precisely the box-annotation convention Kontext / Qwen-Image-Edit respond to. Off, it's the image plain, so you can inspect what you're sending.

So you can wire up a full mask-driven edit - say, an inpaint pass from a SAM or segment-anything mask - with zero Photoshop involved. It's a genuinely useful little glue node on its own.

When you want to draw the region in Photoshop

Switch mode to Wait for first save or Re-run on every save and the node hands the image over with an auto-created empty "Instructions" layer. Paint on that layer with any brush, any color, to mark the region (you can also edit the base image - the mask only comes from the Instructions layer). Save, and you get the same four outputs, now built from your strokes: image is everything but your marks, mask is your marks alone, annotated is them combined. The Re-open in Photoshop button gets you back into the same annotation, strokes intact, after you've closed it. The two Photoshop modes behave exactly like Edit in Photoshop's, right down to the timeout_seconds (default 1800) that stops an abandoned wait from holding your queue hostage.

Install

Standard for this pack - it's not in the Manager registry search yet, so Manager → Install via Git URL (paste the repo) or:

cd ComfyUI/custom_nodes
git clone https://github.com/ericpaulsnowden/comfyui-photoshop-bridge.git comfyui-photoshop-bridge
pip install -r comfyui-photoshop-bridge/requirements.txt

with ComfyUI's own Python, then restart. The plugin (Tier 2) is optional for this node - Pass through never touches Photoshop, and the Photoshop modes work file-based without it, just slower. Pre-1.0 project, actively developed; one tip from the field: if you're iterating against a Qwen-Image-Edit model, turn box_composite on and keep your strokes tight - the box the model reads is your strokes' bounding box, so a sloppy stroke becomes a bigger edit region.

CategoryPhotoshop Bridge/Handoffs (requires Photoshop)

Inputs (6)

NameTypeDefaultDescription
imageIMAGEThe image to annotate.
instructionSTRINGWhat you want changed, in plain words. Passed through as-is to whatever model or node reads the instruction output -- never drawn onto the image.
modeCOMBOPass throughHow to get the mask. 'Pass through' uses the connected mask input (or an empty mask) and never opens Photoshop. 'Wait for first save' opens Photoshop with an editable Instructions layer and pauses the workflow until you paint on it and save. 'Re-run on every save' opens the same Instructions layer without waiting, and re-queues the workflow automatically each time you save.
box_compositeBOOLEANfalseWhen on, the annotated output draws a red box around the masked area instead of showing your painted strokes. When off (default), it shows the image with your actual painted strokes on top.
timeout_secondsINT180010–86400How long to wait for you to save in Photoshop before giving up and stopping the workflow, in seconds. Only used by 'Wait for first save'.
maskoptMASKA mask to use directly, when mode is 'Pass through'. Ignored once Photoshop supplies a mask from the Instructions layer.

Outputs (4)

NameTypeDescription
imageIMAGEThe resolved image: unchanged in Pass through mode, or the composite of every layer except Instructions once Photoshop supplies an edit.
maskMASKThe marked region (1.0 = marked, 0.0 = not) -- from the connected mask input in Pass through mode, or your painted strokes on the Instructions layer otherwise.
instructionSTRINGThe instruction text, unchanged.
annotatedIMAGEThe image with the annotation visible on it: a red box around the masked area (if box_composite is on), or your actual painted strokes (if off).