Image Blend (Swwan)
Layering images without leaving ComfyUI
- background_image
- layer_image
- layer_mask
- image
Image Blend is the node you reach for when you want one image composited on top of another - a watermark, a texture overlay, a logo, a subtle color wash - and you'd rather not export both layers to Photoshop. It's a port of the LayerStyle ImageBlend node, and it brings the full Photoshop-style blend-mode menu with it: 19 modes from normal through overlay, soft_light, hard_light, screen, multiply (spelled "multply" in the dropdown - it's a typo in the source, don't fight it), and so on.
The way to think about it is exactly like a layer in a photo editor. You have a background_image, a layer_image that sits on top, a blend_mode that decides how the top layer interacts with what's under it, and an opacity slider. The output is one composite image.
How it works
Under the hood it converts everything to PIL, blends the layer into the background using the chop/divide algorithms that LayerStyle pioneered, then pastes it back with a mask. The mask is the important bit:
- If your
layer_imagehas a real alpha channel (a transparent PNG), the node reads its alpha automatically. - If you feed a
layer_maskinstead, it uses that - and because ComfyUI masks store1 - alpha(white = keep, black = drop),invert_maskdefaults to true so the mask is flipped back to a normal "white shows the layer" convention.
This is the single most common confusion with the node. If your blend looks like the layer vanished or you're pasting a hard-edged rectangle instead of the shape, check invert_mask and whether you passed a mask at all.
Inputs and outputs
The required set is small and sane: background_image, layer_image, invert_mask, blend_mode, opacity (0-100). Optional layer_mask (MASK). One output, image.
It also handles batches: if you feed N backgrounds and N layers, it blends them pairwise, repeating the last item of any shorter list. That makes it usable on frame sequences, though for actual cross-fades between frames you'd want the pack's dedicated transition nodes instead.
Installing it
It's part of ComfyUI_Swwan. Install the pack (ComfyUI Manager, search "ComfyUI_Swwan") or:
cd ComfyUI/custom_nodes
git clone https://github.com/aining2022/ComfyUI_Swwan
pip install -r ComfyUI_Swwan/requirements.txt
Since this is a migrated node, if you already have ComfyUI_LayerStyle installed you'll have a very similar (some would say identical) node available there too. Having both packs is fine - the "(Swwan)" suffix keeps the display names distinct - but it's worth knowing you're not missing anything by picking one.
Where people get burned
The mask-mismatch path silently replaces the mask with solid white and logs a warning, which can turn a "why is my whole layer showing" mystery into a blank white result if you're not watching the console. And if your layer is JPEG (no alpha) and you pass no mask, the whole rectangle blends - expected, but easy to forget. Start with normal and opacity around 60 to sanity-check the geometry, then switch blend modes once you can see it's positioning right.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| background_image | IMAGE | — | |
| layer_image | IMAGE | — | |
| invert_mask | BOOLEAN | true | — |
| blend_mode | COMBO | 19 options: normal, multply, screen, add, subtract, difference, +13 | |
| opacity | INT | 1000–100 | — |
| layer_maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |