Multi Color Mask V1 (DAELab)
The same mask maths, a much better editor
- images
- mask
There are two Multi Color Mask nodes in this pack and they compute the same mask. The only difference is what you stare at while configuring it - and after about ten colour groups, that difference stops being cosmetic.
Multi Color Mask V1 (DAELab) keeps the original's semantics (inherits from it, same _make_masks path, same distance thresholding in RGB, same combined_mask as an elementwise max) and replaces the editor with a compact two-row layout: one row for colour and threshold, one for inversion, with a selected-group state and icon buttons for insert and delete. There's no per-group enable checkbox at all; a group either exists in the list and is used, or it doesn't.
Why that's better than it sounds
Two concrete things the compact editor buys you.
First, stable selection on insert and delete. In the original, deleting group 3 shifts everything after it down and your mask_3 output silently becomes a different region. In V1 the output target follows the group you had selected rather than the index, so you can delete a rule and not accidentally repoint your mask at the wrong colour.
Second, a single tool bay. The output selector and the add/delete controls live in the same compact toolbar, so choosing "which mask comes out" and "which rules exist" are the same gesture instead of two separate interaction modes. This sounds like a small UI nit until you've done it fifty times in a client session.
The node also folds the group list and the output selector into one combined panel for App Mode, and it reuses the pack's shared bypass logic, so if you bypass or mute the node in a finished app the whole panel collapses cleanly instead of leaving half its inputs exposed.
What you set
The visible inputs are still just images and config_json - the second one is the hidden serialised state that the panel writes. The rest of the schema is the list: as many groups as you need, each with a colour, a threshold in 0..255 RGB distance, and an invert toggle.
Practically, you'll touch three things:
- The colour picker. Ideally clicked straight out of the image, so the hex is the render's actual colour rather than the design file's intended one. Renders drift; the mask should follow what's on screen.
- The threshold. 4–8 for crisp boundaries between flat blocks, 16–30 when the render has soft shading across a region. This is the only value you'll tune per project.
- The output target. One group's mask, or
combined_maskfor the union of everything currently listed.
There's no separate enable/disable - which means "temporarily exclude this colour" is done by deleting the rule, or by setting its threshold to something nothing matches. That's the trade for the compact layout, and it's a reasonable one; just don't expect a checkbox that isn't there.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/TeutonicMepheles/ComfyUI-DAELab-Custom-Nodes-Library.git
Restart ComfyUI, hard-refresh the browser. The V1 editor is a separate front-end module (multi_color_mask_v1.js), so a cached tab is the most likely reason it looks like the old node. ComfyUI Manager users can search the pack title; if you already have the pack, git pull inside the repo folder plus a restart is enough.
V1 is a new node, not a replacement. The original ID DAELabMultiColorMask still exists, so existing workflows keep working - you'll just be picking the V1 node from the DAELab/Mask menu for new graphs.
Gotchas
Don't mix them in one workflow out of confusion. Both register a node whose name starts with "Multi Color Mask"; the V1 one literally says "V1" in the display name, and its category is the same. Check the node's own subtitle if you're ever unsure which instance you just dropped.
Because V1 has no enable flags, combined_mask reflects every group in the list. If a union looks wrong, one of your groups is doing something you forgot about - that's usually a threshold set high enough to overlap a neighbour, not a bug.
config_json is state, not an API. Editing it by hand works (it's a normalised JSON structure) but the panel will happily overwrite your edit next time you touch a control. Treat the UI as the source of truth and, if you want reproducible configs across workflows, copy the whole string from one node to another rather than retyping values.
Output-format wise: mask is a float 0..1 mask at the input resolution, batch-aligned. Feed it to an inpaint, a latent-noise-mask setter, or into this same pack's height-layer node, which uses identical colour groups to assign discrete relief levels.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| config_json | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |