LayerUtility: ImageHub
ImageHub — a 9-way image switch for tidying up busy graphs
- input1_image
- input1_mask
- input2_image
- input2_mask
- input3_image
- input3_mask
- input4_image
- input4_mask
- input5_image
- input5_mask
- input6_image
- input6_mask
- input7_image
- input7_mask
- input8_image
- input8_mask
- input9_image
- input9_mask
- image
- mask
A switch node, and a fairly generous one - up to nine image/mask pairs feed in, and one comes out, picked either by an explicit index or at random. If you've ever built a workflow with several candidate images (different LoRA variants, different seeds, different pipeline branches) and wired a chain of "which one do I actually want to send downstream" logic, this replaces that mess with one node.
How it works
You wire up to nine optional image inputs (each with a matching optional mask), and the node passes through whichever one you selected via output. Set random_output to true and it ignores the index and picks one of the connected inputs at random each run instead - useful for quick A/B comparisons or injecting variety into a batch without manually rewiring which branch feeds forward.
The value here isn't clever processing, it's graph hygiene. A common shape this solves: you've built three or four variant branches (different upscalers, different color grades, different edit-model outputs) that all converge into the rest of the pipeline, and instead of rewiring which branch's noodle plugs into the next node every time you want to compare them, you plug all of them into one ImageHub and just flip a number. It's the same instinct as a physical patch bay - keep everything connected, change which signal is live with one control.
The inputs and outputs that matter
output(default 1, range 1–9) - which numbered input to pass through. Corresponds toinput1_image/input1_maskthroughinput9_image/input9_mask.random_output(default false) - when true, picks randomly among whichever inputs are actually connected, overridingoutput.input1_imagethroughinput9_image(all optional IMAGE), plus matchinginput1_maskthroughinput9_mask(optional MASK) - wire in as many or as few of the nine slots as you actually need; you don't have to fill all of them.
Outputs: a single image and mask, whichever pair got selected.
How to install it
Search ComfyUI Layer Style in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt
Restart; find it under 😺dzNodes → LayerUtility.
Common issues
The obvious one: setting output to a slot number you never actually connected - the node has nothing to pass through and either errors or gives you an empty result, depending on how it's downstream-consumed. Double-check the index matches a slot you genuinely wired something into. The other trap is random_output combined with a workflow that expects deterministic, repeatable results - if you're trying to debug why a graph produces a different final image on reruns with the same seed everywhere else, check whether an ImageHub upstream has random_output flipped on; that's an easy thing to forget you set. Beyond that it's a straightforward router - no processing happens to the image itself, it's purely a "which wire wins" decision.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| output | INT | 11–9 | — |
| random_output | BOOLEAN | false | — |
| input1_imageopt | IMAGE | — | |
| input1_maskopt | MASK | — | |
| input2_imageopt | IMAGE | — | |
| input2_maskopt | MASK | — | |
| input3_imageopt | IMAGE | — | |
| input3_maskopt | MASK | — | |
| input4_imageopt | IMAGE | — | |
| input4_maskopt | MASK | — | |
| input5_imageopt | IMAGE | — | |
| input5_maskopt | MASK | — | |
| input6_imageopt | IMAGE | — | |
| input6_maskopt | MASK | — | |
| input7_imageopt | IMAGE | — | |
| input7_maskopt | MASK | — | |
| input8_imageopt | IMAGE | — | |
| input8_maskopt | MASK | — | |
| input9_imageopt | IMAGE | — | |
| input9_maskopt | MASK | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |