💀Image Blend With Alpha
Stamp a mask onto an image and get a real RGBA cutout
- image
- alpha
- image_with_alpha
You have an image and a mask. You want an actual cutout - an image whose pixels carry that mask as their alpha channel, so you can save a real transparent PNG. That's a two-step annoyance in a lot of workflows, and 💀Image Blend With Alpha is the node that collapses it into one. It's from the S4Tool-Image pack, and the author's own docstring says it plainly: it "mimics the behavior of JoinImageWithAlpha."
The mechanism is simple and worth knowing. The node takes your IMAGE and your MASK, crops the image down to the opaque region of the mask (so you don't haul a sea of transparent pixels around), and merges the mask in as the alpha channel of an RGBA image. The result is a true cutout tensor, not a black-background composite or a mask that you'd have to manually apply later. If you've used other ComfyUI packs, this is the same operation as JoinImageWithAlpha from WAS, just rebadged and living in the 💀S4Tool category.
Inputs and output
image- the IMAGE whose pixels you're keeping.alpha- a MASK. This becomes the transparency. White areas of the mask stay opaque; black areas vanish.mask_mode-maskorinvert mask. The invert option flips the mask before applying, which is your shortcut when the mask you have is "keep everything except X."
One output: image_with_alpha (an IMAGE in RGBA). Wire it into a Save Image / PNG output, a compositor, or anything that accepts RGBA.
The crop-to-opaque behavior is the part people either love or get surprised by: if your mask only covers part of the image, the output is smaller than the input - the transparent borders are trimmed. For most cutout use that's a feature (a tight PNG instead of a padded one). If you need the canvas size preserved, you'll want to pad it back after, or reach for a straight composite node instead.
Install
It ships with the S4Tool-Image pack, so:
cd ComfyUI/custom_nodes/
git clone https://github.com/S4MUEL-404/ComfyUI-S4Tool-Image.git
pip install -r ComfyUI-S4Tool-Image/requirements.txt
Or via ComfyUI Manager: search "S4Tool-Image" → Install → restart.
No model downloads here - this node is pure Pillow/numpy, so it's one of the safe, fast ones in the pack.
Gotchas
- Output smaller than input - that's the intended crop-to-opaque behavior, not a bug.
- Everything transparent / everything opaque - check your
mask_mode. If the mask semantics feel backwards,invert maskis the one-word fix. - Masked-out areas are gone, not black - the pixels are dropped, not filled with a color. If you need a colored background behind the cutout, composite this output over a solid image (the pack's 💀Image Color is handy for that).
That pairing - 💀Image Color as a background plus this node's cutout over it - is a surprisingly common little workflow, and it's why these two nodes sit together in the same pack.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| alpha | MASK | — | |
| mask_mode | COMBO | mask | 2 options: mask, invert mask |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image_with_alpha | IMAGE | — |