Nodes/ComfyUI-YogurtNodes/Save Mask Bridge (Yogurt Nodes)
ComfyUI Node

Save Mask Bridge (Yogurt Nodes)

The four-knob mask saver

By yogurt7771·Created 2 years ago·Updated 4 days ago· 1
Save Mask Bridge (Yogurt Nodes)
  • masks
  • masks
  • width
  • height
  • batch
  • saved_paths
output_dir
filename_prefixComfyUI
overwritefalse

Save Mask Bridge Simple is the pared-down mask saver in the Yogurt pack: four inputs, no format dropdown, no compression sliders, no metadata toggle. It writes your mask to disk as a PNG and passes it back through the graph, which is the entire value proposition.

Stock ComfyUI has no SaveMask node, so before packs like this one, keeping a copy of a selection meant compositing the mask onto a colored canvas, saving that, and losing the actual single-channel mask data in the process. This node just does the right thing. The masks input takes a MASK tensor (single or batched), and you get masks, width, height, batch and saved_paths on the way out.

The settings that exist:

  • output_dir - blank saves to the ComfyUI output directory.
  • filename_prefix - base filename, %date:yyyy-MM-dd% and node-value tokens supported.
  • overwrite - off by default, so filenames auto-increment.

That's it. PNG output, workflow metadata embedded, counter-suffixed filenames - all the sensible defaults, none of the decisions.

When Simple is the right pick

For the common "save the mask as an artifact" case, Simple is honestly the best version of this node. Fewer widgets on the canvas, nothing to misconfigure, and the defaults match what you'd choose anyway. You reach past it only if you need a different format (use Save Mask Bridge or the Ex variant) or you want to strip the embedded workflow metadata for privacy (that toggle lives on the full version).

Install

The one-install-for-everything rule holds:

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. Look for "Save Mask Bridge Simple" under Yogurt Nodes → IO.

Gotchas

The usual: overwrite=false means repeated runs stack numbered files rather than replacing a fixed name, so flip it if another tool watches a specific path. And since it saves PNG always, you're on the lossless side of the mask-save question - good. If you later load that PNG back in and the mask looks slightly "off," the usual culprit is the reload side treating it as an 8-bit grayscale image, not this node.

CategoryYogurtNodes/IO

Inputs (4)

NameTypeDefaultDescription
masksMASKThe masks to save.
output_dirSTRINGThe directory to save the masks to, leave blank to save to the ComfyUI output directory.
filename_prefixSTRINGComfyUIThe prefix for the file to save. This may include formatting information such as %date:yyyy-MM-dd% or %Empty Latent Mask.width% to include values from nodes.
overwriteCOMBOfalseOverwrite existing files.

Outputs (5)

NameTypeDescription
masksMASK
widthINT
heightINT
batchINT
saved_pathsLIST