ComfyUI Node

Compositor V4

Layers, drawing tools, and a real canvas — still alpha

By beyondprompting·Created 9 months ago·Updated 7 months ago· 0
Compositor V4
  • config
  • image
  • fabricData_output
  • imageName_output
  • layer_outputs
fabricData
imageName
seed0

Compositor V4 is the rewrite of the pack's signature canvas node: an interactive editor where you place, rotate, scale, flip, and layer up to eight images (plus a foreground drawing layer) before running your scene through a sampler. V4 is the one with the layers panel, the paint/erase tools, the snap-to-grid - everything that makes it feel like a mini compositor instead of a fancy paste tool.

The honest headline, though, is in the changelog: this is an alpha preview. V3 is still there and still maintained. V4 was a "major rewrite" with a complete UI overhaul, and the author lists known issues - sub-pixel positioning, some transform tools disabled, occasionally unreliable erase - that you should assume you'll hit before you build your whole production workflow on it.

How it works

Like V3, the flow is: wire a config from Compositor Config V4, run once so the canvas loads, arrange your layers, mouse-out to auto-save (the green border flashes orange), then continue. V4 adds real layer management - thumbnails, drag-to-reorder, visibility toggles - plus drawing tools on a foreground layer, a color picker, brush size/shape controls, and numerical width/height inputs for exact placement.

Under the hood the node uses the newer comfy_api extension API, parses the fabricData JSON (the canvas state), and applies each layer's transform to its raw image and mask to build the final flattened image plus per-layer outputs. The seed widget exists so the compositor can nudge execution when the composition changes; imageName is the snapshot file the canvas re-loads.

The V4 output set is: image (the composite), fabricData_output (the state JSON - feed it to the transforms-output node), imageName_output (the snapshot filename), and layer_outputs (the per-layer bundle for the masks-output node).

The inputs that matter

  • config (required) - the COMPOSITOR_CONFIG from Compositor Config V4. This is where images, masks, and canvas size actually live.
  • fabricData, imageName, seed (required) - auto-managed state strings. Leave them alone until you're comfortable digging into JSON.

Outputs: image, fabricData_output (STRING), imageName_output (STRING), layer_outputs (COMPOSITOR_OUTPUT_MASKS).

Install

Part of ComfyUI-Beyond_nodes. ComfyUI Manager → search "Beyond_nodes" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/beyondprompting/ComfyUI-Beyond_nodes

Restart. V4 uses the new extension API, so it needs a recent ComfyUI; the startup log prints "Failed loading Compositor nodes" if your build is too old.

Common issues

  • Known-issue bingo: erase restoring erased foreground, positions not pixel-perfect, equalize/distribute disabled, and mask output temporarily removed in early V4. Read those as "expected in alpha," not bugs you're supposed to fix.
  • The flow stops to "compose." That's the design - first run stops until you arrange. onConfigChangedContinue in the config controls whether later changes pause or grab-and-continue. Watch random seeds upstream; a stop-and-restart re-rolls them.
  • Heavy canvases. The README again: avoid eight 4K images on a 4K canvas. V4 is "very heavy depending on the size."
  • V3 vs V4? If you want stability, use V3. If you want the layers panel and drawing tools and can tolerate alpha jank, V4 is genuinely nicer - just don't bet a deadline on it.
Categoryimage

Inputs (4)

NameTypeDefaultDescription
fabricDataSTRINGJSON string containing the compositor state (transforms, positions, visibility). Auto-managed by the compositor interface
imageNameSTRINGName of the snapshot image file. Auto-generated based on graph and node ID
seedSTRING0Random seed value that changes on each save to trigger node re-execution. Auto-updated by the compositor interface
configCOMPOSITOR_CONFIGConfiguration from CompositorConfig4 containing canvas size, images, masks, raw tensors, and settings

Outputs (4)

NameTypeDescription
imageIMAGEFinal composed image rendered from the compositor canvas
fabricData_outputSTRINGCompositor state data (transforms, positions, etc.)
imageName_outputSTRINGFilename of the saved composition snapshot
layer_outputsCOMPOSITOR_OUTPUT_MASKSLayer outputs (images and masks) for Compositor4MasksOutput node