Image to List (RMBG)
Gather up to six images into one list
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- IMAGE
- WIDTH
- HEIGHT
- BATCH_SIZE
Collect up to six separate images into a single list so a downstream node can run over all of them, one at a time, instead of you building six copies of the same chain. It's the image-only sibling of the pack's Image and Mask to List node - same idea, minus the masks.
Lists are ComfyUI's way of saying "apply this to each of these." A node fed a list executes once per item. So if you've got six product shots and you want to background-remove all of them, you gather them here and feed the list into the remover, which then iterates. Without a list you'd be wiring six parallel branches by hand, which is exactly the tedium this node exists to kill.
How it works
You plug images into numbered slots - image_1 through image_6 - and it packs the connected ones into a list, optionally normalizing their sizes so the list is uniform. Empty slots are ignored, so you can wire in two or five, whatever you have.
The inputs and outputs that matter
image_1…image_6(all optional) - the images to gather. Connect as many as you need.resize_mode-off,crop, orfit. How to reconcile mismatched input sizes:cropcenter-crops to a common size,fitscales to fit,offleaves them alone (only safe when they're already the same size). Set this tocroporfitif your sources vary, or downstream batching will complain.
Outputs: IMAGE (the list), plus WIDTH, HEIGHT, and BATCH_SIZE - the count is useful for driving loop logic or sanity-checking that all your inputs made it in.
How to install it
- ComfyUI Manager: search
Comfyui-RMBG, install, restart. - Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/1038lab/ComfyUI-RMBG, thenpip install -r requirements.txt, and restart.
No model - pure plumbing, ready when the pack loads.
Common issues
The list-versus-batch distinction is the thing to understand. This outputs a list (separate items), which is what per-item nodes want. Some nodes instead want a batch (one stacked tensor, requires identical sizes). If a downstream node throws a shape error, it probably wanted a batch - either convert, or set resize_mode so every image matches and can be stacked. Also double-check BATCH_SIZE equals the number of images you connected; if it's lower, a slot you thought was wired isn't. And if your images need to travel with masks, use Image and Mask to List instead so the pairing survives.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| resize_mode | COMBO | crop | 3 options: off, crop, fit |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — | |
| image_6opt | IMAGE | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| WIDTH | INT | — |
| HEIGHT | INT | — |
| BATCH_SIZE | INT | — |