Nodes/24oiduts-ComfyUI/Studio42 Layer Composer
ComfyUI Node

Studio42 Layer Composer

A two-image compositor with blend modes, transforms, and proxy smarts

By GeekyGhost·Created 12 months ago·Updated 10 months ago· 0
Studio42 Layer Composer
  • background
  • foreground
  • foreground_mask
  • composite_image
  • composite_mask
blend_modenormal
opacity1.00
x_position0
y_position0
position_modecustom
scale_x1.00
scale_y1.00
fit_modenone
maintain_aspecttrue
rotation0.0
anchor_x0.50
anchor_y0.50
flip_horizontalfalse
flip_verticalfalse
feather_edges0
anti_aliasingtrue
clip_to_backgroundtrue
use_proxy_workflowtrue
proxy_max_resolution2048
upscale_methodbicubic
batch_processing_modeauto
max_chunk_size16

Studio42 Layer Composer takes a background and a foreground image and composites them: blend modes, pixel-precise positioning, scaling, rotation around an anchor, flipping, feathering, and a mask input - the standard layer stack you'd expect from an image editor, as a node. It's the natural landing spot after the pack's Background Remover: cut your subject out with a mask, composite it here, and you've got a replacement-background workflow with no Python.

It's not flashy and it's not AI - and that's the point. Sometimes you need to put a foreground on a background exactly, and this node gives you the controls to do it without leaving the graph.

The inputs that matter

  • background and foreground - the two images.
  • blend_mode - 17 modes including normal, multiply, screen, overlay, soft_light, hard_light, color_dodge, color_burn, difference, and exclusion. soft_light/overlay are the ones for realistic lighting integration.
  • opacity - 0–1 global alpha for the foreground.
  • foreground_mask - optional MASK; this is how you bring in a cutout from a background-removal node.
  • position_mode - custom (uses x/y) or one of nine presets (center, corners, edges).
  • x_position / y_position - pixel coordinates from the top-left, ±4000.
  • scale_x / scale_y - independent scaling, with maintain_aspect (on by default) to lock them together.
  • fit_mode - none, fit_width, fit_height, fit_both, fill, stretch for auto-sizing the foreground.
  • rotation - ±360°, around anchor_x/anchor_y (0–1, center 0.5/0.5).
  • flip_horizontal / flip_vertical, feather_edges (0–50), anti_aliasing, clip_to_background.

The proxy and batch stuff (actually useful)

  • use_proxy_workflow - scales large images down for fast processing, then upscales the result (via upscale_method: bilinear, bicubic, lanczos). On by default, and it's why big composites don't crawl.
  • batch_processing_mode - auto, full_batch, or chunked, with max_chunk_size for memory-safety on batches. ComfyUI eats a lot of VRAM on image batches; this is the pack handling that for you.

What comes out

composite_image (IMAGE) and composite_mask (MASK) - the latter being the effective placement mask, handy if you want to inspect or reuse where the foreground landed.

Installing it

Same pack, 24oiduts-ComfyUI:

  • ComfyUI Manager: search 24oiduts, install, restart.
  • Manual:
    cd ComfyUI/custom_nodes/
    git clone https://github.com/GeekyGhost/24oiduts-ComfyUI
    pip install -r 24oiduts-ComfyUI/requirements.txt
    then restart.

Pillow, numpy, and opencv-python cover it - no model downloads. The GitHub README is a stale Studio42 template; ignore the "WIP" banner.

Troubleshooting

  • Composite looks off-center - check position_mode; presets override x/y. Set it to custom for direct coordinate control.
  • Foreground scaled weirdly - toggle maintain_aspect and check fit_mode is none if you want raw x/y scaling.
  • Slow on huge images - confirm use_proxy_workflow is on; it exists precisely for this.
  • Foreground edges visible - feed a feather (feather_edges 3–8) or start from a real mask.

The one you'd actually reach for when a background replacement needs to look intentional rather than pasted.

CategoryStudio42/Composition

Inputs (25)

NameTypeDefaultDescription
backgroundIMAGE
foregroundIMAGE
blend_modeCOMBOnormal17 options: normal, multiply, screen, overlay, soft_light, hard_light, +11
opacityFLOAT1.000–1
foreground_maskoptMASK
x_positionoptINT0-4000–4000X coordinate (pixels from left, 0 = left edge)
y_positionoptINT0-4000–4000Y coordinate (pixels from top, 0 = top edge)
position_modeoptCOMBOcustomPositioning mode - 'custom' uses x/y coordinates directly
scale_xoptFLOAT1.000.01–5
scale_yoptFLOAT1.000.01–5
fit_modeoptCOMBOnone6 options: none, fit_width, fit_height, fit_both, fill, stretch
maintain_aspectoptBOOLEANtrue
rotationoptFLOAT0.0-360–360
anchor_xoptFLOAT0.500–1
anchor_yoptFLOAT0.500–1
flip_horizontaloptBOOLEANfalse
flip_verticaloptBOOLEANfalse
feather_edgesoptINT00–50
anti_aliasingoptBOOLEANtrue
clip_to_backgroundoptBOOLEANtrue
use_proxy_workflowoptBOOLEANtrueScale down large images for faster processing
proxy_max_resolutionoptINT2048512–4096Maximum resolution for proxy processing
upscale_methodoptCOMBObicubicMethod for upscaling final result
batch_processing_modeoptCOMBOautoauto=intelligent, full_batch=fastest, chunked=safest
max_chunk_sizeoptINT161–64Maximum images per chunk (only used in chunked mode)

Outputs (2)

NameTypeDescription
composite_imageIMAGE
composite_maskMASK