凤希AI - 图像管理器 - 图片加载
Batch image loading for people who hate duplicate nodes
- 图片
- 遮罩
- 当前图片路径
- 总图片数量
- 宽度
- 高度
FxAiLoadImageByIndex (凤希AI - 图像管理器 - 图片加载) is the image half of the fxai-toolkit "load by index" family, and it exists for one reason: so one node can stand in for a folder full of images. You point it at a directory, give it an index, and it loads that image plus a blank mask and a pile of useful metadata - width, height, the path, and the total count in the folder. Wire that count into a loop and you've got a batch image pipeline that never needs its graph touched again.
It works the same boring, reliable way its audio sibling does: scan the folder, filter to image extensions (.jpg, .jpeg, .png, .bmp, .gif, .tiff, .webp), sort by filename, and load 图片索引 % total. Note the wrap-around: index 47 on a 20-image folder silently loads image 7. That's a feature for looping - one pass ends, the loop continues from the top - but it can look like a bug if you expected an out-of-range error. (Contrast: the audio version returns a silent placeholder on overflow; this one wraps instead. Different choices, same vibe.)
The inputs:
图片文件夹路径- folder to scan. Empty folder raises a hard error, so check your path before queueing.图片索引- which file, starting at 0.刷新标记(optional) - a force-input INT that re-scans the folder when it changes. Drop a button or a changed value on this when you add files mid-run and want the total to update.
Outputs are the useful part: 图片 (IMAGE), 遮罩 (MASK - a blank white mask at the image's dimensions, handy when you want to compose or mask with a clean slate), 当前图片路径, 总图片数量, 宽度, and 高度. The width/height pair alone kills the "I need to know the size to build my latent" dance.
Install is the whole-pack routine: ComfyUI Manager → search "fxai-toolkit", or cd ComfyUI/custom_nodes && git clone https://github.com/fxai666/fxai-toolkit, restart. The pack auto-installs soundfile and psutil and wants FFmpeg available. And a translation note you'll hit within five minutes: every label is Chinese. This is a deliberately Chinese-first pack from 凤希AI - support lives in QQ group 775649071 and on Bilibili - so 图片文件夹路径 is your folder box, 图片索引 your picker.
Troubleshooting is mostly folder-management: a nonexistent path raises "文件夹不存在", an empty folder raises "文件夹中没有找到图片", and a folder full of unsupported extensions is effectively empty. Keep files sorted by name if you want a predictable order (that's the only ordering it gives you), and remember the mask is a convenience, not a real alpha channel - if you need actual transparency, look at the image itself.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| 图片文件夹路径 | STRING | — | |
| 图片索引 | INT | 0 | — |
| 刷新标记opt | INT | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| 图片 | IMAGE | — |
| 遮罩 | MASK | — |
| 当前图片路径 | STRING | — |
| 总图片数量 | INT | — |
| 宽度 | INT | — |
| 高度 | INT | — |