Composite Images
Photoshop-style blend modes for compositing two image batches
- images_a
- images_b
- masks
- images
Composite Images is Photoshop's blend-mode dropdown, ported into ComfyUI. Give it two image batches and it composites B onto A using one of 14 blend modes - normal, multiply, overlay, difference, the hue/color/lighten/darken family, and a couple more beyond that. If you've used layer blend modes in Photoshop or GIMP, the math is identical here; if you haven't, the short version is that each mode is a different formula for combining two pixel values, ranging from "just replace" (normal), through "always gets darker or lighter" (multiply, lighten), to "boost contrast around the midpoint" (overlay, hard light).
How it works
There's no substitute for eyeballing this one - multiply vs. overlay vs. difference will look completely different depending on what's actually in your two images, and picking blindly from the name alone rarely gets you the result you pictured. The node also takes an optional mask, which restricts the blend to only the masked region instead of the whole frame - pair it with something like SaltCLIPSegLoader's output (once it's turned into an actual mask downstream) or a hand-drawn mask when you only want the effect hitting part of the image.
The inputs and outputs that matter
images_a,images_b(required, IMAGE) - your base and overlay batches.mode(enum, 14 choices: normal, color, color_burn, color_dodge, darken, difference, exclusion, hard_light, hue, lighten, multiply, overlay, and two more beyond that) - the whole point of the node.blend_percentage(default 1, 0–1) - your opacity slider. 1 is a full blend, 0 leavesimages_auntouched.masks(optional, MASK) - restricts the blend to a region instead of the whole frame.
Output is images, a normal batch - drop it into Save Image or keep compositing further.
How to install it
ComfyUI Manager: search SaltAI-Open-Resources or SaltAI, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/get-salt-AI/SaltAI
then restart. No heavy dependency, no model - this is pure pixel math.
Common issues & troubleshooting
Shape-mismatch error before the blend even runs. images_a and images_b need matching batch size and resolution. Resize or crop one to match the other first - this node doesn't do that for you.
difference or exclusion produce near-black output and it looks broken. It isn't. Both modes are built to highlight where two images diverge, not where they agree - if your two images are nearly identical, near-black is the correct, expected result, not a bug.
A mask you wired in seems to be ignored. Check that it's actually shaped to match the image batch - a single-frame mask against a multi-image batch is a common reason a mask silently does nothing, since there's a shape mismatch happening quietly rather than an obvious error.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images_a | IMAGE | — | |
| images_b | IMAGE | — | |
| mode | COMBO | 14 options: normal, color, color_burn, color_dodge, darken, difference, +8 | |
| blend_percentage | FLOAT | 1.000–1 | — |
| masksopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |