LC Image Blend Advance ποΈ
Put a layer on a background, 29 blend modes deep
- layer_image
- background_image
- layer_mask
- image
- mask
ComfyUI's stock ImageCompositeMasked does exactly one thing: paste the layer on top. No screen, no multiply, no opacity control, no rotation. The moment you want a glow, a shadow, or a subject standing at a slight angle, you're either writing a graph that fakes it or you're opening Photoshop.
This is the node for the middle ground. Place the layer where you want it - position, scale, aspect, rotate, mirror - then blend it into the background with one of 29 Photoshop-style modes through an optional mask. It's the compositing step from the product-photography pipeline (cut the subject out, generate a scene, composite, relight) done in-graph.
How it works
Pure torch, no model, no extra dependency. The layer is transformed, resampled, and then combined with the background using standard W3C compositing formulas - the same math Photoshop has used for thirty years.
The one thing to know: background_image is optional. Leave it unconnected and the layer goes onto a transparent canvas the size of the layer, with the RGBA output using the computed mask as its alpha. That's the LayerStyle V3 behavior, and it's the useful mode when you want a cutout with real alpha rather than a subject pasted on a color.
Setting it up
layer_image and (optionally) background_image are your inputs. If the layer has an alpha channel, it's used as part of the mask.
Positioning is x_percent and y_percent - the layer's center, as a percentage of the background, so 50/50 is dead center and the steps are 0.01, which is more precision than you'll ever need and means you can nudge by typing rather than dragging. Then scale (a multiplier), aspect_ratio (stretches the layer height; 1 keeps proportions), mirror (none/horizontal/vertical), and rotate in degrees counter-clockwise.
blend_mode is the list. normal, dissolve, darken, multiply, color_burn, linear_burn, lighter_color⦠through to the non-separable modes. Two entries need context from the author's own tooltip: overlay looks at the background, hard_light looks at the layer. LayerStyle's older ImageBlend nodes had those two swapped. If a workflow you copied from a LayerStyle tutorial looks wrong, flip swap_roles - on plus overlay reproduces the old LayerStyle "overlay", which was a standard hard_light.
opacity (0β100 in 0.1 steps) dials the whole thing back, and it's what you'll actually use most. layer_mask (optional, white = layer shows) multiplies with the layer's own alpha, and invert_mask flips it.
transform_method picks the resampling filter - lanczos for sharpest downscales, bicubic, bilinear, or nearest for pixel art where you specifically do not want smoothing. The author notes rotation always samples bicubic regardless, matching PIL. anti_aliasing (0β4) smooths rotated edges by drawing larger and shrinking, which is the difference between a clean 15Β° rotation and a stair-stepped one.
Outputs are image and mask, where the mask is where the layer landed - handy for feeding a downstream refine or an inpaint pass that should only touch the composite region.
Where it earns its place
Three real uses. Multiply/screen for shadows and glows without a diffusion pass - deterministic, instant, and no face-rewriting side effects. Compositing a cutout onto a generated background at a chosen size and position, which is the whole "subject in a scene" job. And the transparent-canvas mode as a pure layer builder when you need RGBA out of a graph that keeps dropping alpha.
The thing it will not do is fix light. Dropping a subject onto a background with a different key direction leaves them reading as pasted, and no blend mode rescues that - that's a relighting job (IC-Light-style) or at minimum a color-match pass. Blend modes are about how pixels combine, not about whether the result is physically believable.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC_MaskMaker_nodes
# restart ComfyUI
Manager users: search LC MaskMaker. This node is torch-only, so it loads even if the pack's model-backed nodes are erroring out on your machine.
Gotchas
- The layer's edges look chewed after rotating. Raise anti_aliasing to 2β3. It's on by default at 2 for a reason; 0 turns it off and you'll see why.
- "Dissolve" doesn't look like Photoshop. Dissolve is a threshold against the opacity alpha rather than a smooth fade, so it's chunky by design. If you wanted a soft fade, you wanted opacity.
- The mask doesn't line up with the layer. The output mask is where the layer ended up, post-transform - not the layer mask you fed in. That's correct behavior and it's what makes it chainable.
- Your alpha disappeared. Some upstream nodes quietly drop the fourth channel; check that the layer still has alpha before blaming this node. Feeding an explicit layer_mask sidesteps the whole question.
- Pixel art comes out blurry.
transform_methoddefaults to lanczos, which is the wrong answer for sprites. Set it to nearest.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| layer_image | IMAGE | The layer. An alpha channel, if it has one, is used. | |
| blend_mode | COMBO | normal | Standard blend modes. overlay looks at the background, hard_light looks at the layer. LayerStyle's older ImageBlend nodes had these two swapped; see swap_roles. |
| opacity | FLOAT | 100.00β100 | Layer strength in percent. |
| swap_roles | BOOLEAN | false | Swap which image is the base and which is the blend for the mode's formula. On + overlay reproduces LayerStyle ImageBlend's old 'overlay' (a standard hard_light). |
| invert_mask | BOOLEAN | false | Flip layer_mask (black becomes visible). |
| x_percent | FLOAT | 50.00-999β999 | Layer center, as a percent of the background width. 50 = centered. |
| y_percent | FLOAT | 50.00-999β999 | Layer center, as a percent of the background height. 50 = centered. |
| mirror | COMBO | None | 3 options: None, horizontal, vertical |
| scale | FLOAT | 1.0000.01β100 | Layer size multiplier. |
| aspect_ratio | FLOAT | 1.0000.01β100 | Stretches the layer height. 1 = keep proportions. |
| rotate | FLOAT | 0.00-3600β3600 | Degrees, counter-clockwise. |
| transform_method | COMBO | lanczos | How the layer is resampled when scaled or rotated. lanczos is the sharpest for resizing; nvidia_rtx_vsr enlarges with RTX Video Super Resolution (RTX cards, shrinking uses lanczos); rotation itself always samples with bicubic, like PIL. |
| anti_aliasing | INT | 20β4 | Smooths rotated edges by drawing them larger and shrinking. 0 = off. Higher is slower. |
| background_imageopt | IMAGE | The image the layer is placed on. Leave it unconnected to place the layer on a transparent canvas the size of the layer (the output is then RGBA, with the mask as its alpha). | |
| layer_maskopt | MASK | White = the layer shows. Multiplied with the layer's alpha, if any. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| mask | MASK | β |