Nodes/InsertAnything-ComfyUI-official/InsertAnything - Mask Option
ComfyUI Node

InsertAnything - Mask Option

A glorified light switch for masks

By mo230761·Created about a year ago·Updated about a year ago· 26
InsertAnything - Mask Option
  • sketch
  • upload
  • MASK
optionsketch

The easiest node in the pack, and the easiest to skip

Mask Option is a two-input mask selector. That's it. It takes a sketch mask, an upload mask, and an option dropdown that chooses which one comes out the other end. One MASK in, one MASK out. No math, no resize, no judgment.

So why does it exist? In the shipped InsertAnything workflow, your reference and source images come from LoadImage nodes, and LoadImage has a built-in mask channel (the "upload" mask). But ComfyUI also lets you draw masks freehand with the "sketch" tools. This node just makes it a one-click choice which of those feeds the rest of the graph:

  • sketch - a mask you painted in ComfyUI, for when you want to eyeball the region yourself.
  • upload - the mask channel that came in with the image, for when you prepared masks in an editor or generated them with SAM/Grounded-SAM and saved them alongside.
  • option - the switch, defaulting to sketch.

It's genuinely useful for A/B testing two mask sources without rewiring anything, and it keeps the reference and source halves of the graph symmetric. The main thing it does not do is mask generation - for that you're looking at SAM, GroundingDINO, or a VLM grounding pipeline (the "you don't have to paint the mask anymore" route from the inpainting best-practices docs).

The one trap

Both sketch and upload are required inputs. You can't leave one dangling just because you never use it - every load of the workflow will complain about the missing connection. Feed both in (LoadImage's mask output covers upload fine), then flip the dropdown. That's the whole manual.

Install

Same as the rest of the pack. ComfyUI Manager: search InsertAnything or Install via Git URLhttps://github.com/mo230761/InsertAnything-ComfyUI-official.git. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/mo230761/InsertAnything-ComfyUI-official.git

Restart ComfyUI. If the pack fails to load, it's usually the missing-dependency gotcha: there's no requirements.txt, but the nodes import cv2 and diffusers at load time, so install them into the ComfyUI env (pip install opencv-python diffusers).

Is it worth a page?

Honestly, Mask Option is the kind of node you stop noticing after ten minutes. But it's also a decent mental model for the whole pack: InsertAnything is six small geometry/mask plumbing nodes wrapped around one real idea - reference plus mask on the left, target plus mask on the right, Flux does the rest. This one just picks which mask.

Categorysd

Inputs (3)

NameTypeDefaultDescription
sketchMASK
uploadMASK
optionCOMBOsketch2 options: sketch, upload

Outputs (1)

NameTypeDescription
MASKMASK