ComfyUI Node

RGBYP Save Mask

RGBYP Save Mask

By akawana·Created 9 months ago·Updated 7 days ago· 5
RGBYP Save Mask
  • rgbyp_mask
  • rgbyp_mask
file_path
file_name
add_postfixtrue
overridetrue

The RGBYP editor's dirty secret is also its one real gotcha: your painted masks live in ComfyUI's temp/ folder, and ComfyUI wipes that folder on every restart. Browser refresh? Your mask survives. Full restart? Gone. RGBYP Save Mask is the fix - it writes the mask out as a PNG so you can load it back next session, or on a completely different day.

It's not a complicated node. rgbyp_mask goes in, a PNG lands on disk, and the image passes through the output unchanged so you can keep the rest of your graph wired without breaking the chain.

The inputs that matter

  • rgbyp_mask - the five-color mask IMAGE from RGBYP Load Image or RGBYP Mask Bridge. The actual payload.
  • file_path and file_name - strings that come straight from RGBYP Load Image's file_path (directory) and file_name (base name) outputs. Wire those two and your mask gets saved next to the image you painted it on. Leave them empty and it falls back to saving into input/rgbyp_masks/ with the name mask.
  • add_postfix (default true) - appends _rgbyp_mask to the saved filename so it can't be confused with the source image.
  • override (default true) - true means "overwrite the last mask"; false means "keep every version, incrementing 01, 02 … 99" as a crude version history.

How it saves

The node writes a PNG, preserving the alpha channel when the mask has one - the README's advice is that any mask saver works here since "it is just an image," but remember to save with alpha if you want a clean editable mask. Two small touches: it quietly refuses to write a fully-black mask (saves you a folder full of nothing), and it saves only the first batch item, so this isn't a batch saver.

The workflow that makes it useful

  1. Paint your mask with RGBYP Load Image.
  2. Wire file_path and file_name into RGBYP Save Mask.
  3. Run once. The mask now sits next to your source image.
  4. Next session, reopen the image in RGBYP Load Image and use its Load Mask button to pull the saved mask back in.

That's the entire persistence story for this pack, and it's genuinely painless - the pair is designed around each other.

Installing it

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/akawana/ComfyUI-RGBYP-Mask-Editor.git

then restart ComfyUI, or ComfyUI Manager → search RGBYP. No models, no extra dependencies.

The honest caveat

file_path comes from RGBYP Load Image, and that node's path detection only works reliably inside the input folder - same-named files in different subfolders can resolve to the wrong directory. If your saves land somewhere odd, that's the cause. And since it's just a PNG, don't feel locked in: any image-save node does the same job. This one just wires up to the pack's helpers without any assembly required.

CategoryAK/RGBYP

Inputs (5)

NameTypeDefaultDescription
rgbyp_maskIMAGE
file_pathSTRING
file_nameSTRING
add_postfixBOOLEANtrue
overrideBOOLEANtrue

Outputs (1)

NameTypeDescription
rgbyp_maskIMAGE