Nodes/ComfyUI-enricos-nodes/Compositor Config V4
ComfyUI Node

Compositor Config V4

8 image slots, serialized masks, and the save-format knobs you'll forget about

By erosDiffusion·Created 2 years ago·Updated about a month ago· 634
Compositor Config V4
  • image1
  • mask1
  • image2
  • mask2
  • image3
  • mask3
  • image4
  • mask4
  • image5
  • mask5
  • image6
  • mask6
  • image7
  • mask7
  • image8
  • mask8
  • config
width512
height512
padding100
normalizeHeightfalse
onConfigChangedContinuefalse
invertMaskfalse
saveFormatPNG Level 0 (fastest)
saveFolderoutput

CompositorConfig4 is the V4 equivalent of the V3 config node - the unglamorous feeder that turns up to 8 images (with optional masks) into the COMPOSITOR_CONFIG object the Compositor V4 canvas consumes. The V4 version adds two things V3 didn't have: explicit save-format and save-folder controls, and a slightly different masking path where masks are serialized to disk under fixed names like cfg{node_id}-mask1.png so they survive workflow reloads.

Connect its config output to Compositor4's config input. That's the whole wiring job.

What to actually set

  • width / height - canvas size, your export resolution. 512 default, step 32. Set it to what you want out.
  • padding - the parking zone around the export area (100 default). Drag assets out there to stash them or reach transform handles; the green border shows the real export region.
  • normalizeHeight - force all inputs to one height, aspect preserved. Quick and dirty; can degrade quality.
  • onConfigChangedContinue - the big one. Off (default) means the flow pauses so you can compose; on means it grabs a snapshot and continues. The author labels the on-state "Grab and Continue", and warns there is no real pause - with a random seed upstream this can loop.
  • invertMask - flip alpha on all masks before they're applied.
  • saveFormat - PNG Level 0 (fastest, the default) up to PNG Level 9 (smallest files), plus JPEG, WebP Lossless, and BMP. PNG is lossless and the safe choice; JPEG will drop your alpha.
  • saveFolder - where the snapshot and masks live: temp (wiped on restart, won't survive reloads), input, or output (default, inside a compositor/ subfolder). If you want your composition to survive a browser refresh, don't use temp.

Then image1image8 and mask1mask8, all optional. Image order is z-order - image1 is the farthest back, image8 the frontmost.

Output: a single config socket. That's it.

Installing

Standard pack install - ComfyUI Manager, search "Compositor", pick erosDiffusion; or:

cd ComfyUI/custom_nodes
git clone https://github.com/erosDiffusion/ComfyUI-enricos-nodes.git

No model downloads, no extra pip packages.

Gotchas worth knowing

Masks here are applied in the config node (baked into RGBA) rather than left to the canvas, and a config signature hash - computed from every input including file hashes of the images and masks - is what tells the Compositor whether to stop and let you recompose. So changing anything on this node, even an image upstream, correctly triggers a pause. If you edit a workflow and the canvas suddenly demands attention, that's the signature changing, not a bug.

One practical trap: pick saveFolder deliberately. Images saved to temp don't survive reloads, and if your composition vanishes after a refresh, that's why. And keep the canvas sensible - 8 images at 4k each will choke both this node's file writes and the browser canvas.

Categoryimage

Inputs (24)

NameTypeDefaultDescription
widthINT5120–16384Width of the composition area in pixels
heightINT5120–16384Height of the composition area in pixels
paddingINT1000–16384Extra space around the composition area for positioning images outside the canvas
normalizeHeightBOOLEANfalseScale all input images to the same height while maintaining aspect ratio
onConfigChangedContinueBOOLEANfalseWhen enabled, automatically grabs the snapshot and continues execution. When disabled, pauses to allow manual composition
invertMaskBOOLEANfalseInvert the alpha channel of all input masks before applying them to images
saveFormatCOMBOPNG Level 0 (fastest)Image format for saving compositor images. PNG Level 0 is fastest, Level 9 creates smallest files
saveFolderCOMBOoutputFolder where compositor images and masks are saved: temp (temporary), input, or output directory
image1optIMAGEFirst input image (optional)
mask1optMASKAlpha mask for first image (optional)
image2optIMAGESecond input image (optional)
mask2optMASKAlpha mask for second image (optional)
image3optIMAGEThird input image (optional)
mask3optMASKAlpha mask for third image (optional)
image4optIMAGEFourth input image (optional)
mask4optMASKAlpha mask for fourth image (optional)
image5optIMAGEFifth input image (optional)
mask5optMASKAlpha mask for fifth image (optional)
image6optIMAGESixth input image (optional)
mask6optMASKAlpha mask for sixth image (optional)
image7optIMAGESeventh input image (optional)
mask7optMASKAlpha mask for seventh image (optional)
image8optIMAGEEighth input image (optional)
mask8optMASKAlpha mask for eighth image (optional)

Outputs (1)

NameTypeDescription
configCOMPOSITOR_CONFIGConfiguration object containing compositor settings and processed images with mask filenames