BlendImage
Photoshop layer stacking, inside the graph
- image_1
- mask_1
- image_2
- mask_2
- image_3
- mask_3
- image_4
- mask_4
- image_5
- mask_5
- image
BlendImage is a layer stack that happens to live in a node instead of a Photoshop panel. Up to five images, each with its own opacity, blend mode, and optional mask, composited down onto a background color in order. If you've ever wanted to overlay a texture at 30% multiply, drop a logo on top at normal blend, and mask out a corner - this is the node that does all three in one box instead of chaining three separate composite nodes together.
It matters more on a headless service like this than it would on your desktop: there's no Photoshop in the loop, so any layering you'd normally do by hand has to happen in-graph or not at all.
How it works
Think of it as a canvas painted with bg_color first, then each active layer painted on top in order - layer 1, then layer 2, and so on up to however many images_count says are active. Each layer has its own alpha (opacity), its own blend mode, and its own optional mask that controls where on the canvas that layer shows through.
The inputs and outputs that matter
images_count (1–5) is the first thing to set - it tells the node how many of the five layer slots to actually composite. Plug in more images than this number and they're just ignored, which is the single most common way people get confused by this node.
Each layer i (1 through 5) gets the same four knobs:
alpha_i(0–1) - opacity of that layer.mode_i- one of 17 blend modes:normal,darken,multiply,color_burn,linear_burn,lighten,screen,color_dodge,linear_dodge,overlay,soft_light,hard_light, and five more - the same set you already know if you've used Photoshop or GIMP layers.mask_blur_iandmask_strength_i- feathering and intensity for that layer's mask, so the cutout doesn't have a hard, obviously-composited edge.
Optional inputs, one set per layer: image_i and mask_i - the actual pixels and, if you want the layer masked, the mask for it. There's also one shared bg_color, given as a packed RGB integer (default 16777215 = white, 0xFFFFFF; 0 = black) rather than a color picker, since this is the underlying value ComfyUI stores for a color widget.
One output: a single composited image.
How to install it
Search ComfyUI-HakuImg in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone --recurse-submodules https://github.com/licyk/ComfyUI-HakuImg
Restart ComfyUI, then find it under Image → HakuImg. No models, no heavy dependencies - it's array-level pixel math.
Common issues & troubleshooting
Wired in three images but only two show up. Check images_count - it defaults lower than you might expect and doesn't auto-detect how many image_i slots you've connected. Bump it to match.
A layer's mask throws an error or does nothing. The mask has to match the image dimensions for that layer; resize it first if it came from a different-sized source than the image it's masking.
bg_color isn't behaving like a color picker. It's an integer, not a swatch - 16777215 is white and 0 is black, with values in between representing packed RGB. If you need a specific background color, compute the RGB-to-int value rather than guessing.
A blend mode looks identical to normal. Some modes (like darken or lighten) only show a visible difference where the layer's pixels are actually darker or lighter than what's underneath - on a layer with a very different overall tone from the background, some modes will barely register. That's expected behavior for these blend modes, not a bug in the node.
Inputs (32)
| Name | Type | Default | Description |
|---|---|---|---|
| images_count | INT | 21–5 | — |
| alpha_1 | FLOAT | 1.000–1 | — |
| mask_blur_1 | FLOAT | 4.000–32 | — |
| mask_strength_1 | FLOAT | 1.000–1 | — |
| mode_1 | COMBO | normal | 17 options: normal, darken, multiply, color_burn, linear_burn, lighten, +11 |
| alpha_2 | FLOAT | 1.000–1 | — |
| mask_blur_2 | FLOAT | 4.000–32 | — |
| mask_strength_2 | FLOAT | 1.000–1 | — |
| mode_2 | COMBO | normal | 17 options: normal, darken, multiply, color_burn, linear_burn, lighten, +11 |
| alpha_3 | FLOAT | 1.000–1 | — |
| mask_blur_3 | FLOAT | 4.000–32 | — |
| mask_strength_3 | FLOAT | 1.000–1 | — |
| mode_3 | COMBO | normal | 17 options: normal, darken, multiply, color_burn, linear_burn, lighten, +11 |
| alpha_4 | FLOAT | 1.000–1 | — |
| mask_blur_4 | FLOAT | 4.000–32 | — |
| mask_strength_4 | FLOAT | 1.000–1 | — |
| mode_4 | COMBO | normal | 17 options: normal, darken, multiply, color_burn, linear_burn, lighten, +11 |
| alpha_5 | FLOAT | 1.000–1 | — |
| mask_blur_5 | FLOAT | 4.000–32 | — |
| mask_strength_5 | FLOAT | 1.000–1 | — |
| mode_5 | COMBO | normal | 17 options: normal, darken, multiply, color_burn, linear_burn, lighten, +11 |
| bg_coloropt | INT | 167772150–16777215 | — |
| image_1opt | IMAGE | — | |
| mask_1opt | MASK | — | |
| image_2opt | IMAGE | — | |
| mask_2opt | MASK | — | |
| image_3opt | IMAGE | — | |
| mask_3opt | MASK | — | |
| image_4opt | IMAGE | — | |
| mask_4opt | MASK | — | |
| image_5opt | IMAGE | — | |
| mask_5opt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |