Nodes/ComfyUI-Majoor-ImageOps/〽️ ImageOps Comp
ComfyUI Node

〽️ ImageOps Comp

Stack layers in the graph — a mini compositor that lives inside ComfyUI

By MajoorWaldi·Created 8 months ago·Updated 8 days ago· 11
〽️ ImageOps Comp
  • background_color
  • image
  • mask
bypassfalse
use_first_layer_sizetrue
auto_layeringfalse
width1024
height1024
layers_json{"version":1,"layers":[]}
invert_maskfalse

ImageOps Comp is the multi-layer compositor of the ComfyUI-Majoor-ImageOps pack - the node you pull out when two images plus a blend mode isn't enough and you don't want a tangle of nested merge nodes. Plug in as many layers as you want, and each one gets its own blend mode, opacity, position, and mask, all arranged in one node with a live preview you can drag layers around on. It's the closest thing in the pack to a mini Photoshop/After Effects stack that stays inside your workflow graph.

How it works

You feed layers into dynamic image_1, image_2, … slots (with matching mask_1, mask_2, … for per-layer mattes). The layer list is managed by the preview UI: a ➕ button adds a layer, and each layer has a blend-mode selector and opacity slider. Drag layers directly on the preview canvas to position them. Keyboard users get 19 to select a layer by index and Delete/Backspace to remove the selected one - useful once you've got six layers stacked.

The arrangement state lives in layers_json (auto-managed by the UI), so your compositing is part of the workflow and survives a save/reload just like any other node parameter. Under the hood each layer composites with standard canvas blend math - over, add, multiply, screen, overlay, soft-light, difference, lighten, darken, color-dodge, color-burn, exclusion - the usual suspects.

The canvas controls

  • use_first_layer_size (default on) - the first connected layer defines the canvas format. Disable it to set your own width/height instead.
  • auto_layering - use the largest connected layer's dimensions as the canvas. Handy when your foregrounds are bigger than your background.
  • width / height (1–8192) - manual canvas size when you've turned off the automatic modes. aspect_ratio offers presets that derive these for you.
  • background_color - canvas fill behind everything.
  • invert_mask flips the output mask; bypass passes the first layer through unchanged.

Outputs

image (the flattened comp) and mask (the comp's alpha). Both batch-first, so comping a video stack - say, a subject clip over an animated background - works frame-by-frame without extra thinking.

Where it fits

If you only ever composite two things, ImageOps Merge is simpler. Comp earns its keep at three-plus layers: character over background, a light-wrap element, a grain pass on top - each with its own opacity and blend instead of a pyramid of merge nodes. It's also the natural pairing with Corner Pin (pin a screen, then comp it into a scene layer in Comp).

Install and gotchas

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) - this node is UI-heavy, and a stale frontend cache is the classic reason the layer controls look missing. No models, no extra dependencies.

Two things to know before you fight it: if your layers are wildly different sizes and nothing lines up, check use_first_layer_size vs auto_layering - one of them matches what you're picturing. And the layers panel is stateful via layers_json; if a saved workflow loads with layers missing, the JSON probably didn't survive the round-trip, so re-add them in the UI rather than hand-editing the text.

Categoryimage/imageops

Inputs (8)

NameTypeDefaultDescription
bypassBOOLEANfalse
use_first_layer_sizeBOOLEANtrueUse the first connected layer as the comp format. Disable to force Width/Height.
auto_layeringBOOLEANfalseUse the largest connected layer dimensions as the canvas format.
widthINT10241–8192
heightINT10241–8192
background_colorCOLOR#000000
layers_jsonSTRING{"version":1,"layers":[]}
invert_maskBOOLEANfalse

Outputs (2)

NameTypeDescription
imageIMAGE
maskMASK