Josia多图加载
The batch image loader that runs the whole pipeline once per picture
- images
- images_out
- image_1
- image_2
- image_3
- image_4
- image_5
- image_6
- image_7
- image_8
- image_9
- image_10
- image_11
- image_12
- image_13
- image_14
- image_15
- image_16
- image_17
- image_18
- image_19
- image_20
- image_21
- image_22
- image_23
- image_24
- image_25
- image_26
- image_27
- image_28
- image_29
- image_30
- image_31
- image_32
- image_33
- image_34
- image_35
- image_36
- image_37
- image_38
- image_39
- image_40
- image_41
- image_42
- image_43
- image_44
- image_45
- image_46
- image_47
- image_48
- image_49
- image_50
- total_count
JosiaMultiImageLoader (Josia多图加载) is the "caption a folder of images without clicking Queue forty times" node. Drop a pile of images in - upload, drag-and-drop, or paste - and it either hands them to downstream nodes as a proper batch or, in its smartest mode, makes ComfyUI run the entire rest of the workflow once per image automatically. For image-to-text pipelines (captioning, tagging for training data), that single feature is the whole reason to install it.
List mode vs batch mode
The output_mode switch chooses the personality:
- List mode (default off → on):
images_outreturns a Python list and the node marks that output with ComfyUI'sOUTPUT_IS_LISTflag. Downstream nodes that support list expansion get executed N times - once per image - in a single queue. Feed it 40 photos and a llama.cpp captioning node runs 40 times, no manual batching, no seed-increment hacks. Each image keeps its own correct aspect and size, so nothing gets letterboxed. - Batch mode: all images get merged into one torch batch. This is the mode for pixel-pipeline stuff like img2img over a folder. Caveat, from the README, is an honest math limitation: if the images have mixed aspect ratios, a tensor batch has to be one canvas size, so ComfyUI letterboxes the odd ones out (black bars). If you need each image at its true size, use list mode or the per-image ports.
The per-image ports and the scaling panel
There are 50 individual image_1 … image_50 outputs plus a total_count (INT), so you can also wire specific slots into specific downstream nodes - deterministic positions instead of a fold. And the resize panel handles the "VAE wants ~1MP" problem: enable_resize master switch, megapixels (0 = no scaling), edge_value for longest/shortest-edge scaling, resolution_steps for progressive downscaling (the README recommends 2–16 steps for big shrink jobs to cut aliasing), interpolation (lanczos default), and multiple_of alignment (default 16, matching VAE tiles). The images optional input lets an upstream image slot in before the loaded ones.
Install
Zero extra Python dependencies:
cd ComfyUI/custom_nodes
git clone https://github.com/Josia-doit/ComfyUI_JosiaNodes
or via ComfyUI Manager (search ComfyUI_JosiaNodes), restart. The whole gallery UI (thumbnails, drag-drop, sort) is frontend JS - the README is explicit that this node depends on web/js, so don't prune that folder.
Gotchas
First: the mixed-ratio letterboxing isn't a bug, it's PyTorch tensors being rectangular. When someone's caption file has a 4:3 photo labeled with a 9:16 letterbox, that's batch mode doing its job - use list mode or per-image ports. Second: list mode explicitly doesn't support upstream list chaining; if you need to feed a list from another node in, set the upstream to batch mode. And finally, list mode + heavy VLM models multiplies your VRAM budget by N - queueing 50 image caption runs on a 6GB card is how you learn patience.
One thing to be clear about: if your goal is a manual gallery where you pick images by hand from a dropdown, that's the stock LoadImage's job. This node's superpower is automation - it wants to feed the whole folder through, not stand there while you choose one.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image_paths | STRING | (内部使用)图片路径列表,由前端图库区管理,无需手动输入 | |
| enable_resize | BOOLEAN | true | 图像缩放总开关:✅ 开启 = 按下方设置对每张图进行等比缩放(原功能不变);❎ 原图直出 = 完全跳过缩放,图像以原始分辨率、原始像素(与原生 LoadImage 一致:EXIF 方向修正 + 转 RGB)直接透传到下游,不做任何等比/黑边/格式处理。关闭后下方「缩放模式 / 百万像素 / 缩放步数 / 边长方向 / 边长值 / 缩放算法 / 对齐倍数」全部灰化失效。 |
| resize_mode | BOOLEAN | true | 开关:🖼️ 按像素缩放 = 按总像素目标等比缩放(每张图独立计算);📐 按边长缩放 = 按长边或短边等比缩放 |
| megapixels | FLOAT | 0.000–16 | 目标总像素(百万像素),0=不缩放(原图直出),1.0≈1024×1024。每张图按自身比例独立计算。仅在「按像素缩放」模式下生效。 |
| resolution_steps | INT | 11–16 | 缩放步数,分几步渐进缩放到目标分辨率(默认1=一步到位)。步数越多,大比例缩小时质量越好但越慢。仅在「按像素缩放」模式下生效。 |
| edge_direction | BOOLEAN | true | 开关:➡️ 按长边缩放 = 长边适配目标值、短边等比;⬇️ 按短边缩放 = 短边适配目标值、长边等比 |
| edge_value | INT | 00–16384 | 边长目标像素值,0=不缩放。仅在「按边长缩放」模式下生效。 |
| interpolation | COMBO | lanczos | 缩放插值算法:lanczos高质量/nearest最近邻/bilinear双线性/bicubic双三次/area区域/nearest-exact精确最近邻 |
| multiple_of | COMBO | 16 | 尺寸对齐倍数(默认16适配VAE),0=不对齐。每张图独立对齐。 |
| output_mode | BOOLEAN | false | 开关:📦 图像批次 = 所有图像合并为一个 batch(混合比例时 letterbox 黑边);📋 图像列表 = 按序号逐张输出,下游逐张执行(无黑边)。⚠️ 图像列表模式不支持上游列表串联——如需串联,请将上游节点设为批次模式。 |
| imagesopt | IMAGE | 上游图像列表,将插入本节点图像之前合并输出 |
Outputs (52)
| Name | Type | Description |
|---|---|---|
| images_out | IMAGE | — |
| image_1 | IMAGE | — |
| image_2 | IMAGE | — |
| image_3 | IMAGE | — |
| image_4 | IMAGE | — |
| image_5 | IMAGE | — |
| image_6 | IMAGE | — |
| image_7 | IMAGE | — |
| image_8 | IMAGE | — |
| image_9 | IMAGE | — |
| image_10 | IMAGE | — |
| image_11 | IMAGE | — |
| image_12 | IMAGE | — |
| image_13 | IMAGE | — |
| image_14 | IMAGE | — |
| image_15 | IMAGE | — |
| image_16 | IMAGE | — |
| image_17 | IMAGE | — |
| image_18 | IMAGE | — |
| image_19 | IMAGE | — |
| image_20 | IMAGE | — |
| image_21 | IMAGE | — |
| image_22 | IMAGE | — |
| image_23 | IMAGE | — |
| image_24 | IMAGE | — |
| image_25 | IMAGE | — |
| image_26 | IMAGE | — |
| image_27 | IMAGE | — |
| image_28 | IMAGE | — |
| image_29 | IMAGE | — |
| image_30 | IMAGE | — |
| image_31 | IMAGE | — |
| image_32 | IMAGE | — |
| image_33 | IMAGE | — |
| image_34 | IMAGE | — |
| image_35 | IMAGE | — |
| image_36 | IMAGE | — |
| image_37 | IMAGE | — |
| image_38 | IMAGE | — |
| image_39 | IMAGE | — |
| image_40 | IMAGE | — |
| image_41 | IMAGE | — |
| image_42 | IMAGE | — |
| image_43 | IMAGE | — |
| image_44 | IMAGE | — |
| image_45 | IMAGE | — |
| image_46 | IMAGE | — |
| image_47 | IMAGE | — |
| image_48 | IMAGE | — |
| image_49 | IMAGE | — |
| image_50 | IMAGE | — |
| total_count | INT | — |