Layer Info Array Fuse
Render your layer blueprint into real images and masks
- fuseImage
- fuseMask
- fuseProductImage
- fuseProductMask
- referenceBGImage
- layerImages
- prompt
- correctColor
- renderStrength
- colorStrength
- outlineStrength
"Layer Info Array Fuse" is where this pack's layer system stops being data and becomes pixels. Feed it the JSON blueprint you built with "Init Layer Info Array" and one or more "Added Layer Info To Array" nodes, and it assembles the composite: it opens each layer's image, resizes and rotates it into place, stacks the layers in order, and hands you the fused result as images, masks, and a per-layer list.
It's a surprisingly complete mini compositor. Each layer file is opened from ComfyUI's input folder, resized to the layer's declared width/height with Lanczos, rotated (expanding the layer's footprint), and pasted at its position. Stacking order matters: when a new layer is placed, its opaque area punches through the layers already underneath - so a hand layer placed over a product actually hides the part of the product it covers. There's also a separate composite built from only the layers whose type is Product, which is handy when you care about just the product's silhouette.
What comes out
This node returns eleven outputs, so here's the map:
- fuseImage / fuseMask - the full composite and its mask (ComfyUI convention: white = foreground).
- fuseProductImage / fuseProductMask - the same, but only
Product-typed layers. - referenceBGImage - the background image you picked in Init.
- layerImages (LAYER_IMAGES) - the per-layer list (original image, placed/deformed image, and type) that feeds "Layer Image Seleted" and the IPAdapter node.
- prompt, correctColor - pass-throughs of the blueprint's fields.
- renderStrength, colorStrength, outlineStrength - see the gotcha below.
The gotchas worth knowing
First, the three strength outputs are hardcoded to 0 in the current source regardless of what you set in Init. The values still live inside the JSON string if something downstream reads that, but the dedicated INT outputs won't reflect them. It's a work-in-progress quirk, not a settings bug on your end.
Second, if reference_bg was left empty in Init, you get a 100×100 white placeholder instead of a real background - set the field or expect a small white square.
Third, all the heavy lifting happens on the CPU via PIL, and every layer file is opened fresh each run. Keep layer counts modest; a dozen full-res layers will take a beat.
Where it fits
Typical chain: Init → (several) Added → Fuse → wire fuseImage into a sampler or fuseProductMask into an inpainting region, and feed layerImages into the pack's per-layer IPAdapter node to condition generation on the individual layers. That's the workflow this pack is really built for.
Installing it
Part of longgui0318/comfyui-common-util:
cd ComfyUI/custom_nodes
git clone https://github.com/longgui0318/comfyui-common-util
cd comfyui-common-util && pip install -r requirements.txt
Restart after, or use ComfyUI Manager and search "comfyui-common-util". requirements.txt lists only opencv-python, but the pack imports scipy, scikit-image, and PyWavelets at load - if it won't load, pip install scipy scikit-image PyWavelets then restart. The IPAdapter half of the family additionally needs cubiq's ComfyUI_IPAdapter_plus.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| layerInfoArrayJson | STRING | — |
Outputs (11)
| Name | Type | Description |
|---|---|---|
| fuseImage | IMAGE | — |
| fuseMask | MASK | — |
| fuseProductImage | IMAGE | — |
| fuseProductMask | MASK | — |
| referenceBGImage | IMAGE | — |
| layerImages | LAYER_IMAGES | — |
| prompt | STRING | — |
| correctColor | BOOLEAN | — |
| renderStrength | INT | — |
| colorStrength | INT | — |
| outlineStrength | INT | — |