Compositor Config V4
8 image slots, serialized masks, and the save-format knobs you'll forget about
- image1
- mask1
- image2
- mask2
- image3
- mask3
- image4
- mask4
- image5
- mask5
- image6
- mask6
- image7
- mask7
- image8
- mask8
- config
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, oroutput(default, inside acompositor/subfolder). If you want your composition to survive a browser refresh, don't use temp.
Then image1–image8 and mask1–mask8, 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.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 5120–16384 | Width of the composition area in pixels |
| height | INT | 5120–16384 | Height of the composition area in pixels |
| padding | INT | 1000–16384 | Extra space around the composition area for positioning images outside the canvas |
| normalizeHeight | BOOLEAN | false | Scale all input images to the same height while maintaining aspect ratio |
| onConfigChangedContinue | BOOLEAN | false | When enabled, automatically grabs the snapshot and continues execution. When disabled, pauses to allow manual composition |
| invertMask | BOOLEAN | false | Invert the alpha channel of all input masks before applying them to images |
| saveFormat | COMBO | PNG Level 0 (fastest) | Image format for saving compositor images. PNG Level 0 is fastest, Level 9 creates smallest files |
| saveFolder | COMBO | output | Folder where compositor images and masks are saved: temp (temporary), input, or output directory |
| image1opt | IMAGE | First input image (optional) | |
| mask1opt | MASK | Alpha mask for first image (optional) | |
| image2opt | IMAGE | Second input image (optional) | |
| mask2opt | MASK | Alpha mask for second image (optional) | |
| image3opt | IMAGE | Third input image (optional) | |
| mask3opt | MASK | Alpha mask for third image (optional) | |
| image4opt | IMAGE | Fourth input image (optional) | |
| mask4opt | MASK | Alpha mask for fourth image (optional) | |
| image5opt | IMAGE | Fifth input image (optional) | |
| mask5opt | MASK | Alpha mask for fifth image (optional) | |
| image6opt | IMAGE | Sixth input image (optional) | |
| mask6opt | MASK | Alpha mask for sixth image (optional) | |
| image7opt | IMAGE | Seventh input image (optional) | |
| mask7opt | MASK | Alpha mask for seventh image (optional) | |
| image8opt | IMAGE | Eighth input image (optional) | |
| mask8opt | MASK | Alpha mask for eighth image (optional) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| config | COMPOSITOR_CONFIG | Configuration object containing compositor settings and processed images with mask filenames |