小珠光图像加载器
The LoadImage replacement that fixes the boring part
- images
- mask
Core ComfyUI's LoadImage is fine until you want to load a stack of images, or check the alpha channel, or see what you loaded without squinting. 小珠光图像加载器 (Xiaozhuguang Image Loader) is the 小珠光 take on the loader: drag-and-drop upload, multi-image batch mode, a pinyin-searchable file list, a checkerboard background so transparency is visible, and an editable mask - all in one node. It's the LoadImage you reach for when your workflow starts eating batches instead of single files.
If you're feeding a batch of reference images to a pipeline, or you need per-image masks without a separate masking step, this is the loader that does both from the same node. It reads from input/ (and understands the [output] / [temp] filename annotations ComfyUI uses for cross-folder loading), and it outputs images as a list when in batch mode - the shape many batch-processing nodes actually want.
How it works
It decodes each image in your list (the image_list widget, one filename per line) with the same EXIF-aware, alpha-aware logic as core LoadImage, and - the useful bit - derives a MASK output from the alpha channel when there's no hand-drawn mask, matching core behavior: transparent pixels become masked. In batch mode the images come out as a list on the images port; index picks which image to apply any crop to. The front end is where the polish lives: drag files onto the node, search the file list by pinyin, toggle single/batch mode, and paint a mask or crop rectangle right in the preview.
The inputs that matter
image_list- the filenames, one per line, or use the built-in picker.index- which image the crop/mask edit applies to (single-image mode).batch_mode- on = load everything as a list; off = single image atindex.
Outputs: images (IMAGE, a list in batch mode) and mask (MASK).
Install
From the ComfyUI-xiaozhuguang pack - Manager (search "ComfyUI-xiaozhuguang"), or:
cd ComfyUI/custom_nodes/
git clone https://github.com/xiaozhuguang/ComfyUI-xiaozhuguang.git
Restart. No model downloads; the dependencies are Pillow and torch, which ComfyUI already has.
Gotchas
The list-vs-batch distinction bites people who come from core LoadImage: with batch_mode on you get a list of images on the output, and many single-image nodes expect a batched tensor, so you may need a list-to-batch conversion downstream (or flip batch_mode off). And the mask output is 3D (1, H, W) - matching core - so if a node complains about mask shape, it's usually the node, not you. The mask semantics follow core too: white = painted, black = untouched, and transparency-derived masks come out inverted the same way core does. If a mask looks backwards, that's the convention, not a bug.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image_list | STRING | — | |
| index | INT | 00–999999 | — |
| batch_mode | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| mask | MASK | — |