〽️ Image Ops Merge
Blend two images like a compositor — nineteen blend modes and the math to back them
- A
- B
- mask
- image
- mask
ImageOps Merge is the two-input compositor of the ComfyUI-Majoor-ImageOps pack, and it's the node that answers "how do I put this thing over that thing" in nineteen different ways. It takes a background layer A and a foreground layer B and blends them with a proper compositing blend mode - over, add, multiply, screen, overlay, soft_light, difference, lighten, darken, color_dodge, color_burn, exclusion, subtract, max, min, vivid_light, pin_light, hard_mix - plus mix for opacity and real linear-light math.
The settings that matter
mode- the blend. For actual compositing of a subject over a background,overis standard alpha compositing (and it respects the foreground's transparency, which is the one you'll reach for first). The rest are the creative/utility palette:addandscreenbrighten (light, glow, flare passes),multiplydarkens and bakes shadows into a base,overlay/soft_lightare the grain-and-texture-blending workhorses,differenceis a debugging and stylization favorite.mix(0–1) - overall opacity of the blend. 1 = full effect, 0 = just A. The "how strong is this comp" knob.foreground_fit- how B is adapted to A's dimensions before blending:stretch(default),contain,cover, ornone. If your layers don't match size, this is what keeps it sane -containfits B inside A without distortion,coverfills A.blend_space-linear(default) orsrgb. This is the compositor-grade detail: linear performs the blend math in gamma 1.0 space and converts back, which is how correct blend math actually behaves - screen and multiply look right, additive glows behave.srgbdoes it in the encoded space, which is faster and fine for quick looks. Leave it linear; it's the difference between "looks right" and "looks approximately right."
An optional mask (with invert_mask) limits the blend to part of the frame - so A shows through everywhere except where the mask says "use B here." Outputs are image and mask.
Where it fits
This is the pairing node for half the pack: composite a Corner Pin result over a scene, put a Keyer matte over a new background, lay Grain's output with soft_light. When your comp grows past two layers, graduate to ImageOps Comp - but for the vast majority of "blend these two things" moments, Merge is the right-sized tool.
Install
ComfyUI Manager (search "ComfyUI-Majoor-ImageOps"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/MajoorWaldi/ComfyUI-Majoor-ImageOps
Restart and hard-refresh the browser (Ctrl+F5 / Cmd+Shift+R). No models, no extra deps.
The gotchas
The blend_space default of linear occasionally surprises people who expect the exact same result as a photo-editor's sRGB blend - the math differs, especially on overlay. If a blend looks subtly different from what you're used to, that's the explanation, and switching to srgb gives you the familiar result. Second: mismatched layer sizes under stretch distort the foreground by default - set foreground_fit to contain or cover if stretching is unwanted. And remember over needs B to actually carry alpha; a flat RGB image over A just covers it completely until you drop mix.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| A | IMAGE,VIDEO | Background Images/Video input. | |
| B | IMAGE,VIDEO | Foreground Images/Video input. | |
| bypass | BOOLEAN | false | — |
| mode | COMBO | over | 12 options: over, add, multiply, screen, overlay, soft_light, +6 |
| mix | FLOAT | 1.000–1 | — |
| foreground_fit | COMBO | stretch | 8 options: stretch, contain, fit, letterbox, pad, none, +2 |
| blend_space | COMBO | linear | 2 options: linear, srgb |
| invert_mask | BOOLEAN | false | — |
| maskopt | MASK | Optional mask applied to the merged result |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |