Studio42 Layer Composer
A two-image compositor with blend modes, transforms, and proxy smarts
- background
- foreground
- foreground_mask
- composite_image
- composite_mask
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/overlayare 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,stretchfor 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, orchunked, 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:
then restart.cd ComfyUI/custom_nodes/ git clone https://github.com/GeekyGhost/24oiduts-ComfyUI pip install -r 24oiduts-ComfyUI/requirements.txt
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 tocustomfor direct coordinate control. - Foreground scaled weirdly - toggle
maintain_aspectand checkfit_modeisnoneif you want raw x/y scaling. - Slow on huge images - confirm
use_proxy_workflowis on; it exists precisely for this. - Foreground edges visible - feed a feather (
feather_edges3–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.
Inputs (25)
| Name | Type | Default | Description |
|---|---|---|---|
| background | IMAGE | — | |
| foreground | IMAGE | — | |
| blend_mode | COMBO | normal | 17 options: normal, multiply, screen, overlay, soft_light, hard_light, +11 |
| opacity | FLOAT | 1.000–1 | — |
| foreground_maskopt | MASK | — | |
| x_positionopt | INT | 0-4000–4000 | X coordinate (pixels from left, 0 = left edge) |
| y_positionopt | INT | 0-4000–4000 | Y coordinate (pixels from top, 0 = top edge) |
| position_modeopt | COMBO | custom | Positioning mode - 'custom' uses x/y coordinates directly |
| scale_xopt | FLOAT | 1.000.01–5 | — |
| scale_yopt | FLOAT | 1.000.01–5 | — |
| fit_modeopt | COMBO | none | 6 options: none, fit_width, fit_height, fit_both, fill, stretch |
| maintain_aspectopt | BOOLEAN | true | — |
| rotationopt | FLOAT | 0.0-360–360 | — |
| anchor_xopt | FLOAT | 0.500–1 | — |
| anchor_yopt | FLOAT | 0.500–1 | — |
| flip_horizontalopt | BOOLEAN | false | — |
| flip_verticalopt | BOOLEAN | false | — |
| feather_edgesopt | INT | 00–50 | — |
| anti_aliasingopt | BOOLEAN | true | — |
| clip_to_backgroundopt | BOOLEAN | true | — |
| use_proxy_workflowopt | BOOLEAN | true | Scale down large images for faster processing |
| proxy_max_resolutionopt | INT | 2048512–4096 | Maximum resolution for proxy processing |
| upscale_methodopt | COMBO | bicubic | Method for upscaling final result |
| batch_processing_modeopt | COMBO | auto | auto=intelligent, full_batch=fastest, chunked=safest |
| max_chunk_sizeopt | INT | 161–64 | Maximum images per chunk (only used in chunked mode) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| composite_image | IMAGE | — |
| composite_mask | MASK | — |