Snap load
Path in, image and alpha mask out — the return half of the Snap Canvas round trip
- IMAGE
- MASK
Snap load does one thing: it takes a file path as a string, reads that image off disk, and hands you an IMAGE and a MASK. It's the companion to the pack's Snap Canvas node - that node saves its composition to canvas/output.png and returns the path as its string output; this node eats that path and gives you the pixels back, plus a mask derived from the PNG's alpha channel.
Why does that exist when core ComfyUI already ships Load Image? Load Image picks files by name from your input folder. Snap load is path-driven, so it can consume whatever Snap Canvas produces without you copying files around. In fact, its default input is a hint in Chinese that translates roughly to "convert to input and use SnapCanvas's string output" - the author built the two to be wired together. If you never use Snap Canvas, this node is mostly redundant; if you do, it's the natural way to continue the graph.
How it works
Under the hood it's a thin PIL wrapper. It opens the file, applies EXIF orientation, converts to RGB, normalizes to a 0–1 tensor, and outputs it as a batch of one. The mask is the interesting part: if the image has an alpha channel, the mask is 1 - alpha, so fully transparent pixels become white (1.0) in the mask and opaque pixels become black. That's the standard ComfyUI mask convention - white is the region you're selecting, so the transparent parts of your PNG are what downstream mask-aware nodes will act on. If the file has no alpha, you get a 64×64 all-zero mask instead.
It also hashes the source file, so ComfyUI re-runs downstream nodes whenever the image on disk changes - useful when a previous step rewrites the file.
The one input
- image (STRING) - a file path. Type it, or right-click the input, Convert to Input, and wire in Snap Canvas's
stringoutput.
Outputs
- IMAGE - the loaded pixels.
- MASK - alpha-derived mask as described above. Wire it wherever you'd use a mask: compositing, inpainting, or into a mask-aware sampler.
Install
Same pack as Snap Canvas - ComfyUI Manager, search "Snap Processing", or:
cd ComfyUI/custom_nodes
git clone https://github.com/SS-snap/ComfyUI-Snap_Processing
cd ComfyUI-Snap_Processing
pip install -r requirements.txt # just pyqt5
Then restart ComfyUI. Only dependency is PyQt5; no models to download.
Where people get burned
- The default string isn't a path. If you run the node without wiring anything in, it tries to open a file literally named that Chinese hint and errors out. Convert the input to a real connection before executing.
- No alpha, no mask. A transparent-less PNG yields an all-zero mask, and an all-black mask means "select nothing" downstream - silent no-op, not an error. If your mask-aware step seems to do nothing, check whether your file actually carries transparency.
- It's the return half of a round trip. Used standalone it's just a more awkward Load Image - fine, but not the reason it exists.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | STRING | 请转换为输入并SnapCanvas的string输出 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| MASK | MASK | — |