📸 智绘_序列批量加载
The batch-vs-counter sibling
- 图像批次
- 加载数量
Where the pack's counter loader hands you one image per run, this node hands you a whole run of them at once - a contiguous slice of a folder loaded into a single IMAGE batch. Think video frames, animation passes, or a folder of numbered renders you want to feed into a model as a sequence in one go.
It's ZH_ImageSequenceLoader ("📸 智绘_序列批量加载"), part of ComfyUI-ZhiHui, a Chinese-language utility pack that ports several nodes from Dapao-Toolbox. If you've never heard of the pack you're not alone - it has zero footprint in the English ComfyUI subreddits. Don't let that scare you off; the mechanics are simple and visible in the source.
How it works
The flow is boring in the good way: list the folder (blank path falls back to ComfyUI/input), sort by filename, slice with start_index and skip_frames, cap at max_images, convert each image to RGB, and torch.stack them into one batch. skip_frames is the knob to know - 1 loads everything, 2 loads every other frame, so you can halve the frame rate of an animation without re-encoding it. Corrupted files get skipped with a console warning rather than killing the run.
The inputs and outputs that matter
- folder_path - raw OS path; blank uses the ComfyUI input directory.
- start_index - how many files to skip at the front.
- max_images - hard cap (1–1000), defaults to 10.
- skip_frames - decimation factor.
Outputs are 图像批次 (IMAGE, the stacked batch) and 加载数量 (INT, how many actually loaded). Wire the batch straight into a KSampler, an upscaler that eats batches, or the pack's ZH_GridImageAssembler for a contact sheet.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/zhuyungen/ComfyUI-ZhiHui.git
Restart ComfyUI. No extra dependencies beyond torch/numpy/Pillow for this node - no models to download. ComfyUI Manager search "ComfyUI-ZhiHui" works too.
Where people get burned
torch.stack is unforgiving: every frame has to be the same resolution or the whole load fails. The code skips broken files, but it doesn't resize mismatched frames - a folder where one image is 1024×1024 and the rest are 512×512 will error on the stack. If you're loading a mixed folder, normalize sizes first (the pack's ZH_LoadFolder node does exactly that, or use ImageMagick). And keep an eye on max_images: batches of big frames eat VRAM fast, so start small. Unlike its counter sibling, this node loads deterministically every run - no hidden state, no cache weirdness.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | 图片文件夹路径(留空使用ComfyUI/input) | |
| start_index | INT | 00–10000 | 起始索引 |
| max_images | INT | 101–1000 | 最大加载数量 |
| skip_frames | INT | 11–100 | 跳帧:1为全部,2为隔一帧 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| 图像批次 | IMAGE | — |
| 加载数量 | INT | — |