Save Mask Bridge (Yogurt Nodes)
Save masks in any format the pack's plain node won't
- masks
- masks
- width
- height
- batch
- saved_paths
Save Mask Bridge Ex is the "Custom" variant of the pack's mask saver. The plain Save Mask Bridge lets you pick .png or .jpg; this one adds a Custom option in the suffix dropdown backed by a custom_suffix field, so a mask can leave ComfyUI as any format Pillow knows how to write.
Everything else matches the plain version exactly. It takes a MASK tensor in, writes it to disk, and passes it through along with width, height, batch and saved_paths. Same bridge behavior - save is a side effect, the data keeps moving through the graph. Same inputs otherwise: output_dir (blank → ComfyUI output), filename_prefix with %date:yyyy-MM-dd% tokens, disable_metadata, overwrite, png_compression and jpeg_quality. Outputs are masks, width, height, batch, saved_paths.
When Custom actually earns its keep
For masks specifically, you mostly want PNG and you mostly want it lossless - JPEG will blur the selection edge and change which pixels survive your threshold on reload. The interesting custom cases are:
- Feeding external tools. Some inpainting/segmentation pipelines want masks as specific formats (
.bmpfor some OpenCV paths, for instance, or a particular encoding). Being able to force the extension on the way out removes an assumption from whatever reads the file next. - Batch exports. If you're exporting a mask set for dataset work, webp gives smaller files than PNG while staying lossless-ish for grayscale content.
Just remember the tooltip's precedence rule: a non-empty custom_suffix wins over the dropdown. If you select "Custom" and leave custom_suffix empty, there's no extension - keep the two together.
Install
Same one-time pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Or ComfyUI Manager → ComfyUI-YogurtNodes → install → restart. It lives under Yogurt Nodes → IO as "Save Mask Bridge" (the Ex class shares the display name with the plain node, so check the icon/inputs if you have both).
Gotchas
Two things. First, if you've installed the whole pack you may see two nodes named "Save Mask Bridge" in the IO menu - the plain and the Ex versions share a display name. Pick by the inputs: the Ex one has the suffix dropdown with three choices and the extra custom_suffix field. Second, the same JPEG warning applies here as everywhere in the mask family: if a format you choose is lossy, you're degrading the selection, not just compressing a photo. Save masks lossless unless you know why you're not.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| masks | MASK | The masks to save. | |
| output_dir | STRING | The directory to save the images to, leave blank to save to the ComfyUI output directory. | |
| filename_prefix | STRING | ComfyUI | The prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Image.width% to include values from nodes. |
| disable_metadata | COMBO | false | Disable saving metadata to the PNG file. |
| overwrite | COMBO | false | Overwrite existing files. |
| suffix | COMBO | .png | The file extension to save the images as. |
| custom_suffix | STRING | The file extension to save the images as. If this is not empty, the suffix option will be ignored. Otherwise, the suffix option will override above suffix option. | |
| png_compression | INT | 40–9 | The level of compression to use for PNG images. |
| jpeg_quality | INT | 1000–100 | The quality of the JPEG image. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| masks | MASK | — |
| width | INT | — |
| height | INT | — |
| batch | INT | — |
| saved_paths | LIST | — |