Nodes/ComfyUI Layer Style/LayerUtility: ImageBlendAdvance
ComfyUI Node Runs on cloud

LayerUtility: ImageBlendAdvance

ImageBlendAdvance — composite a layer with full position, scale and rotate control

By chflame163·Created 3 years ago·Updated 4 days ago· 3,113
LayerUtility: ImageBlendAdvance
  • background_image
  • layer_image
  • layer_mask
  • image
  • mask
â—„invert_masktrueâ–º
◄blend_mode▾►
â—„opacity100â–º
â—„x_percent50.00â–º
â—„y_percent50.00â–º
◄mirror▾►
â—„scale1.00â–º
â—„aspect_ratio1.00â–º
â—„rotate0.00â–º
◄transform_method▾►
â—„anti_aliasing0â–º

This is the compositing workhorse of the Layer Style pack. ImageBlendAdvance places one image (a layer) over another (a background) and gives you the full transform kit - position, scale, rotation, mirror, aspect ratio, blend mode, opacity - plus a mask input so it respects a cutout. If you've removed a subject's background and now need to drop it onto a scene exactly where you want it, at the right size and angle, this is the node that does it in one shot.

How it works

It's a layer composite with a transform baked in. The layer image gets positioned, scaled, rotated, and optionally mirrored, then blended onto the background according to the blend mode and opacity, with the mask deciding which parts of the layer actually show. Position is expressed as a percentage of the frame, so the placement is resolution-independent - 50/50 is centered regardless of image size.

The inputs that matter

  • background_image and layer_image - the scene and the thing you're placing on it.
  • layer_mask (optional MASK) + invert_mask - the layer's cutout shape. Toggle invert_mask if the wrong region shows through.
  • x_percent / y_percent (default 50/50) - where the layer's center sits, as a percent of the background. This is your main positioning control.
  • scale (default 1.0) - resize the layer. aspect_ratio (default 1.0) stretches it non-uniformly if you need to.
  • rotate (default 0) - rotation in degrees. mirror flips it horizontal or vertical.
  • blend_mode - 19 Photoshop-style modes (normal for a straight paste, plus multiply, screen, and the rest - note the enum's multply typo is the node's, not a mistake here).
  • opacity (default 100) - layer transparency.
  • transform_method (resampler, lanczos default) and anti_aliasing - edge quality of the transformed layer.

Outputs are image (the composite) and mask (the layer's mask after the same transform, so you can chain further).

How to install it

ComfyUI Manager: search ComfyUI Layer Style, install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle

install requirements.txt, restart. It's under 😺dzNodes → LayerUtility.

Common issues

The most frequent one is the layer showing up inverted or with the wrong part cut out - that's invert_mask, flip it. Second: the layer lands off-center or off-screen. Remember x_percent/y_percent position the layer's center as a percent of the background, so 0/0 puts the center in the top-left corner (half the layer off-frame). If a hard-edged transformed layer looks jagged, bump anti_aliasing and keep transform_method on lanczos. The natural pairing is a cutout node upstream - run RmBgUltra V2 or a Segformer mask to isolate the subject, then feed the image and its mask straight into this node to place it on a new background. For a shadow behind that placed layer, DropShadow from the same pack picks up where this leaves off.

Category😺dzNodes/LayerUtility

Inputs (14)

NameTypeDefaultDescription
background_imageIMAGE—
layer_imageIMAGE—
invert_maskBOOLEANtrue—
blend_modeCOMBO19 options: normal, multply, screen, add, subtract, difference, +13
opacityINT1000–100—
x_percentFLOAT50.00-999–999—
y_percentFLOAT50.00-999–999—
mirrorCOMBO3 options: None, horizontal, vertical
scaleFLOAT1.000.01–100—
aspect_ratioFLOAT1.000.01–100—
rotateFLOAT0.00-999999–999999—
transform_methodCOMBO6 options: lanczos, bicubic, hamming, bilinear, box, nearest
anti_aliasingINT00–16—
layer_maskoptMASK—

Outputs (2)

NameTypeDescription
imageIMAGE—
maskMASK—