Nodes/c4f-wire-loom/Loom Mask In
ComfyUI Node

Loom Mask In

Keep inpainting masks attached to the images they belong to

By Codes4Fun·Created 3 months ago·Updated about a month ago· 0
Loom Mask In
  • loom
  • mask
  • LOOM
label

Masks are the wire type that quietly ruins inpainting workflows: they're grayscale, easy to confuse with images, and if the wrong mask reaches an inpaint sampler you get a hole where you wanted a fix. Loom Mask In bundles a MASK into a LOOM stream so each mask travels with its image instead of as a loose, lookalike wire.

Why you'd reach for it

Edit pipelines that do multiple masked passes - fix a face here, an object there - end up juggling several images and several masks. Put each image/mask pair in the loom together (IMAGE and MASK side by side), and each inpainting stage pulls out exactly the pair it needs. Because looms are streams, a stage can also update the mask (erode it, feather it) and push it back in, and later stages get the refined version. That's the whole c4f-wire-loom pitch applied to the most error-prone wire type in the graph.

It also saves you from the classic mix-up: an unlabeled mask and image have distinct keys (MASK vs IMAGE), so the loom won't confuse them - but you can still wire the wrong label into Loom Mask Out if you're careless. The exists output on the out node catches that: it returns False when the key isn't in the loom.

How it works

The standard typed loom insert:

key = f"MASK_{label}" if label else "MASK"
new_loom[key] = mask
return (new_loom,)

Empty label → MASK; a label like faceMASK_face. The matching Loom Mask Out uses the same label. Drag a mask slot onto a collapsed Loom Split hub and the frontend auto-creates the node with the label set.

The inputs that matter

  • mask (MASK): from Load Image (as Mask), segmentation, or mask-editing nodes.
  • label (string): the key. Name multi-mask workflows (face, object) so they don't clobber each other.
  • loom (LOOM, optional): the bundle to extend.

Output is a single LOOM, feeding Loom Split or Loom Join, with the mask pulled back out via Loom Mask Out at each inpainting stage.

Installing

Same pack as the rest of the loom nodes. ComfyUI Manager → search "c4f-wire-loom" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Codes4Fun/c4f-wire-loom

No models, no extra Python packages.

Where it bites

Two unlabeled masks in one loom overwrite each other silently - label them. And remember the stream rule: a mask pushed in after the inpaint stage that needs it won't be seen. The exists output on Loom Mask Out is your friend for debugging - if it's False, your label doesn't match anything in the loom, which is almost always the actual bug. The pack-wide Nodes 2.0 arrow-drag collapse quirk applies too, with the built-in workaround.

Categoryutils/route

Inputs (3)

NameTypeDefaultDescription
loomoptLOOM
maskoptMASK
labeloptSTRING

Outputs (1)

NameTypeDescription
LOOMLOOM