Nodes/BlueBox蓝色多脑盒/Bridge (BlueBox)
ComfyUI Node

Bridge (BlueBox)

Bridge (BlueBox) is a pause button for your graph — paint on the image mid-run, then continue

By zhoutingxi·Created 23 days ago·Updated 5 days ago· 20
Bridge (BlueBox)
  • image
  • reference
  • image
  • mask
◄blockfalse►

The problem it solves is sequencing, not image processing

You have an image at the midpoint of a pipeline - an upscale, a first pass, an inpaint result - and you want to mark it up before the rest of the graph runs on it. ComfyUI's built-in answer is MaskEditor on a Load Image node, which means the mask exists before the pipeline does. Bridge (BlueBox) flips that: it sits in the middle of the graph, receives the upstream image, and holds the door shut until you've opened the BlueBox editor, done your cropping/outpaint/masking/colour work, and clicked continue.

So it's two things welded together - a breakpoint in the execution graph, and a handoff point into a WebGL editor. The editor half is the pack's real product; this node is how you get an image into it mid-graph.

This is the same instinct behind the standard Inpaint Crop → edit → Stitch pattern: you want to intervene at a specific place in the chain, with the pixels that actually exist at that moment, not a pre-loaded file.

How it works, roughly

The backend keeps an in-memory dict of node_id → (image_path, mask_path, preview). On a normal run it grabs the upstream tensor, saves it as a PNG under temp/BlueBoxBridge/, registers that path, and passes the image straight through - so the first run behaves boringly.

When you click continue in the node's UI, the frontend POSTs to /bluebox/bridge_continue, which bumps a per-node counter. IS_CHANGED returns that counter, so ComfyUI sees a changed node and re-executes it; doit then consumes the flag, finds the baked image you exported from the editor, and outputs that instead of the upstream tensor. It's the always-dirty-node trick that IS_CHANGED exists for, dosed carefully: a monotonic sequence number rather than the usual NaN, so the cache is invalidated exactly when you asked for it and not on every run.

The block option is the hard version of the same idea. It's a BOOLEAN in the schema but it renders with the author's own labels, so it reads as a two-value dropdown:

  • never (default, off) - never stop, pass through.
  • if_not_continued (on) - execution halts here and downstream doesn't run until you click continue.

Under the hood that's comfy_execution.graph.ExecutionBlocker returned in place of both outputs. If your ComfyUI is old enough not to have it, the node prints a warning and quietly falls back to passing through - a "block not working" bug report that's really an upgrade notice.

Inputs and outputs

  • image (required) - the upstream image to hand to the editor.
  • block (optional) - as above.
  • reference (optional, IMAGE) - the author's tooltip is blunt about this: it only feeds the editor's "compare against a reference" view. It does not touch the main output and does not affect blocking. Handy for eyeing an edit against the pre-edit or a target; otherwise leave it empty.

Outputs are image and mask. image continues the graph; mask is what the editor exported, or an all-zero mask of matching size if you passed straight through. That zero-mask default matters: don't wire mask into a masked inpaint and assume it's populated unless you actually painted and applied something in the editor.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/zhoutingxi/ComfyUI-BlueBox.git ComfyUI-BlueBox

or search ComfyUI-BlueBox in ComfyUI Manager. Restart, then find Bridge under the BlueBox category. No pip installs - requirements.txt in the repo is empty, and the README's claim of zero third-party dependencies holds (it rides on the numpy/torch/Pillow/aiohttp that ship with ComfyUI). You need a reasonably current ComfyUI for block to do anything, and a browser with WebGL - Chrome or Edge, per the README, because Safari drops IndexedDB after seven days and that's where editor snapshots live.

Common issues

"I hit continue and nothing happened." Check whether the node now shows your edited preview. If it's still the upstream frame, the backend never received the baked file - reopen the editor and hit apply again. The /bluebox/bridge_continue route will happily set the flag for a node that has no baked image, and then the pass-through branch re-injects upstream, which looks like a no-op.

Everything resets when you restart ComfyUI. The cache is a plain in-memory dict, so a restart wipes both the registered paths and the continue counter. The baked files still exist, but the node no longer knows about them. Reopen the editor and apply.

block set to if_not_continued and the graph just… runs. Old ComfyUI, no ExecutionBlocker. The console says so.

Mask comes out empty downstream. You didn't export a mask from the editor, so you got the zeros placeholder. That's not a bug, it's the default.

CategoryBlueBox

Inputs (3)

NameTypeDefaultDescription
imageIMAGE—
blockoptBOOLEANfalseif_not_continued:未点"继续"前,执行到此停住,下游不执行。 never:从不停止,直接放行。
referenceoptIMAGE—

Outputs (2)

NameTypeDescription
imageIMAGE—
maskMASK—