Nodes/ComfyUI_JosiaNodes/Josia多图加载
ComfyUI Node

Josia多图加载

The batch image loader that runs the whole pipeline once per picture

By Josia-doit·Created 6 months ago·Updated a day ago· 16
Josia多图加载
  • 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
image_paths
enable_resizetrue
resize_modetrue
megapixels0.00
resolution_steps1
edge_directiontrue
edge_value0
interpolationlanczos
multiple_of16
output_modefalse

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_out returns a Python list and the node marks that output with ComfyUI's OUTPUT_IS_LIST flag. 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.

Category⚡️JosiaNodes

Inputs (11)

NameTypeDefaultDescription
image_pathsSTRING(内部使用)图片路径列表,由前端图库区管理,无需手动输入
enable_resizeBOOLEANtrue图像缩放总开关:✅ 开启 = 按下方设置对每张图进行等比缩放(原功能不变);❎ 原图直出 = 完全跳过缩放,图像以原始分辨率、原始像素(与原生 LoadImage 一致:EXIF 方向修正 + 转 RGB)直接透传到下游,不做任何等比/黑边/格式处理。关闭后下方「缩放模式 / 百万像素 / 缩放步数 / 边长方向 / 边长值 / 缩放算法 / 对齐倍数」全部灰化失效。
resize_modeBOOLEANtrue开关:🖼️ 按像素缩放 = 按总像素目标等比缩放(每张图独立计算);📐 按边长缩放 = 按长边或短边等比缩放
megapixelsFLOAT0.000–16目标总像素(百万像素),0=不缩放(原图直出),1.0≈1024×1024。每张图按自身比例独立计算。仅在「按像素缩放」模式下生效。
resolution_stepsINT11–16缩放步数,分几步渐进缩放到目标分辨率(默认1=一步到位)。步数越多,大比例缩小时质量越好但越慢。仅在「按像素缩放」模式下生效。
edge_directionBOOLEANtrue开关:➡️ 按长边缩放 = 长边适配目标值、短边等比;⬇️ 按短边缩放 = 短边适配目标值、长边等比
edge_valueINT00–16384边长目标像素值,0=不缩放。仅在「按边长缩放」模式下生效。
interpolationCOMBOlanczos缩放插值算法:lanczos高质量/nearest最近邻/bilinear双线性/bicubic双三次/area区域/nearest-exact精确最近邻
multiple_ofCOMBO16尺寸对齐倍数(默认16适配VAE),0=不对齐。每张图独立对齐。
output_modeBOOLEANfalse开关:📦 图像批次 = 所有图像合并为一个 batch(混合比例时 letterbox 黑边);📋 图像列表 = 按序号逐张输出,下游逐张执行(无黑边)。⚠️ 图像列表模式不支持上游列表串联——如需串联,请将上游节点设为批次模式。
imagesoptIMAGE上游图像列表,将插入本节点图像之前合并输出

Outputs (52)

NameTypeDescription
images_outIMAGE
image_1IMAGE
image_2IMAGE
image_3IMAGE
image_4IMAGE
image_5IMAGE
image_6IMAGE
image_7IMAGE
image_8IMAGE
image_9IMAGE
image_10IMAGE
image_11IMAGE
image_12IMAGE
image_13IMAGE
image_14IMAGE
image_15IMAGE
image_16IMAGE
image_17IMAGE
image_18IMAGE
image_19IMAGE
image_20IMAGE
image_21IMAGE
image_22IMAGE
image_23IMAGE
image_24IMAGE
image_25IMAGE
image_26IMAGE
image_27IMAGE
image_28IMAGE
image_29IMAGE
image_30IMAGE
image_31IMAGE
image_32IMAGE
image_33IMAGE
image_34IMAGE
image_35IMAGE
image_36IMAGE
image_37IMAGE
image_38IMAGE
image_39IMAGE
image_40IMAGE
image_41IMAGE
image_42IMAGE
image_43IMAGE
image_44IMAGE
image_45IMAGE
image_46IMAGE
image_47IMAGE
image_48IMAGE
image_49IMAGE
image_50IMAGE
total_countINT