Eric Qwen Layer Selector
Grab just the flower layer out of your Qwen decomposition
- layers
- alpha_masks
- selected_layers
- selected_masks
- count
Once the Decompose node splits your image into layers, you usually don't want all of them - you want the subject, or the background, or exactly two elements to composite onto something else. EricQwenLayerSelector pulls specific layers out of a batch so the rest of your workflow only sees what you care about.
How it works
You feed in the layers batch (and optionally alpha_masks so the masks stay in lockstep) and pick a selection_mode:
- single: grabs one layer by
index(0 = first layer). - range: grabs
indexthroughend_index, inclusive. - pick_multiple: grabs the comma-separated indices in
indices_csv(e.g.0,2,4). - all_except: keeps everything except
index.
The outputs are selected_layers, selected_masks, and count (INT) - same shape contract as the rest of the pack, so the selection drops straight into the Layer Save, Composite, or any downstream node that takes an IMAGE batch. If you select multiple layers, they come out in the order you asked for, which is handy when you're assembling a specific stack.
Why you'd reach for it
The typical move: decompose a photo into 5 layers, then select just the "White_flower_with_green_leaves" layer and save it as its own PNG, or select the background and the subject separately to composite them onto a new backdrop. It's also the clean way to inspect one layer's alpha without drowning in a 10-layer grid. And because it preserves ordering, you can use pick_multiple to reorder a subset without touching the full reorder node.
The one thing to remember: indices are positional, and the order the Decompose node outputs layers isn't guaranteed to be stable run-to-run unless you fix the seed. If you're selecting by index, keep the seed locked or check layer_info to see what's actually at each position.
Installation is the pack standard - ComfyUI Manager (search "Eric Qwen") or a git clone of the repo into custom_nodes, then restart. Pure tensor slicing under the hood, so no model, no downloads, no VRAM guilt.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| layers | IMAGE | — | |
| selection_mode | COMBO | single | How to select layers |
| index | INT | 00–99 | Layer index for single selection (0 = first layer) |
| alpha_masksopt | MASK | — | |
| end_indexopt | INT | 10–99 | End index for range selection |
| indices_csvopt | STRING | 0,1,2 | Comma-separated indices for pick_multiple mode |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| selected_layers | IMAGE | — |
| selected_masks | MASK | — |
| count | INT | — |