Layer Image Seleted
Pull just the layers you want out of a fused composite
- layer_images
- layer_canvas
- processedImage
- processedMask
- originalImage
"Layer Image Seleted" (yes, the pack's author spells it "Seleted") is the filter node of the layer system. You feed it the per-layer list produced by "Layer Info Array Fuse", pick which layer type you care about, and it composites just those layers into an image and a mask - leaving you a clean way to isolate, say, all the Product layers out of a scene that also contains hands and props.
That kind of isolation is genuinely useful. After you fuse a scene, you often don't want the whole composite - you want the product's region as a mask for inpainting, or the product's image on its own for a style pass. This node gives you the filtered composite, a matching mask, and the original (un-placed, un-rotated) source images of the matched layers, all in one call.
How it works
It walks the layer list, keeps the entries whose type matches your filter (or everything if you pick all), and alpha-composites their placed images in order. The mask is derived from the composite's alpha and inverted to ComfyUI's "white = foreground" convention, so it wires straight into inpainting or conditioning nodes. If no layers match the filter, it gracefully returns the layer_canvas image and a zeroed mask - a clean no-op rather than a crash, which is nice for batch runs where a layer type might be missing.
Inputs and output
- layer_images (LAYER_IMAGES) - from "Layer Info Array Fuse".
- layer_filter_type -
all/Product/Prop/Human-Hand/Human-Male/Human-Female. - layer_need_fuse (BOOLEAN, default on) - declared, but in the current source the fusion path always uses the placed/deformed images, so flipping it doesn't change the output. Vestigial; don't chase it.
- layer_canvas (IMAGE) - the fallback canvas used when nothing matches.
Outputs: processedImage (filtered composite), processedMask, originalImage (the composite of the matched layers' un-deformed originals).
When you'd reach for it
The classic chain is Fuse → Seleted(filtered to Product) → take processedMask into an inpainting or detail-restore region. Or pair it with the pack's per-layer IPAdapter node: you filter once here to see exactly what's being selected, and the IPAdapter node applies the same filter internally to drive conditioning. If your scene has no Prop layers and you filter for Prop, remember you'll get the canvas back, not an error.
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 install via ComfyUI Manager by searching "comfyui-common-util". requirements.txt pins only opencv-python, but the pack imports scipy, scikit-image, and PyWavelets at load - if it fails to load, pip install scipy scikit-image PyWavelets and restart.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| layer_images | LAYER_IMAGES | — | |
| layer_filter_type | COMBO | 6 options: all, Product, Prop, Human-Hand, Human-Male, Human-Female | |
| layer_need_fuse | BOOLEAN | true | — |
| layer_canvas | IMAGE | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| processedImage | IMAGE | — |
| processedMask | MASK | — |
| originalImage | IMAGE | — |