Nodes/comfy_Pond_Nodes/🐳文件夹加载
ComfyUI Node

🐳文件夹加载

Feed a whole folder into a ComfyUI loop without touching the canvas

By Pondowner857·Created about a year ago·Updated 21 days ago· 45
🐳文件夹加载
    • 图像
    • 文本
    • 文件名
    • 索引
    • 文件总数
    • 元数据
    folder_path
    mode随机
    file_type自动
    index0
    seed-1
    pattern*
    recursivefalse
    sort_by名称
    text_mode配对
    previous_index-1

    ComfyUI's built-in Load Image is a manual machine. You pick a file, it loads, you queue. For a 50-image batch you sit there clicking. The 🐳文件夹加载 node from the Pond Nodes pack is the answer to that specific annoyance: point it at a folder and it feeds images (or text, or image+text pairs) through your workflow one at a time, in the order you choose. It's the workhorse loop-feed for batch workflows, and it's the node I'd grab from this whole pack first.

    The name "AdvancedFolderLoader" undersells what it does. It's really three loaders in one. Set mode to 随机 (random), 索引 (index), or 顺序 (sequential), and file_type to 图像 (image), 文本 (text), 自动 (auto-detect), or 图像+文本 (paired). In paired mode a text_mode of 配对 matches each image to its sibling text file by name, while 随机 pairs them randomly - handy when you want prompt-per-image data. Everything is cached per folder on first load, so iterating is fast instead of re-listing the directory every queue.

    The inputs that actually matter

    • folder_path - an absolute path on disk. The placeholder says "输入文件夹路径"; it's a plain string, no ComfyUI folder browser, so paste the full path.
    • mode / index / seed - how you walk the folder. 随机 with a seed shuffles reproducibly; 索引 with index is your manual stepping stone.
    • pattern - a glob like *.png to filter files, and recursive digs into subfolders.
    • sort_by - 名称 / 日期 / 大小, so "sequential" means what you expect.

    You also get an optional previous_index input, which is how you chain two of these nodes so the second follows the first's cursor. Nice for paired folder setups.

    Outputs and where they go

    The node returns six things: 图像 (IMAGE), 文本 (STRING), 文件名 (STRING), 索引 (INT), 文件总数 (INT), and 元数据 (DICT). In practice you wire 图像 into your KSampler path, 文本 into a text encode (paired caption workflows live here), and 索引 into anything that needs to know which step you're on. It's marked as an output node, so it shows in the UI queue view.

    Installing it

    This ships in the Pond Nodes pack - search comfy_Pond_Nodes in ComfyUI Manager, or clone it manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Pondowner857/comfy_Pond_Nodes
    cd comfy_Pond_Nodes && pip install -r requirements.txt
    

    Then restart ComfyUI. The full requirements.txt is heavy (ultralytics, opencv, onnxruntime, mediapipe…), but this node itself only needs the base torch/Pillow/numpy, so it works even if some optional deps fail to install. The catch: when ComfyUI Manager tries to install the whole pack's requirements and one package conflicts, the load can fail entirely - if that happens, install just the base deps and retry.

    Where people get burned

    The README flags a real conflict: this pack and comfyui_HiDream-Sampler fight each other, and the symptom is the console spamming endlessly. If you have that sampler pack installed, this is the first thing to suspect. Also remember the file cache - after you add or delete files in the folder, the node keeps its cached list until you change folder_path (append a character and revert) or restart. And it's a kitchen-sink Chinese-authored pack; the docs are mostly in Chinese, which is exactly what you're reading here in translation.

    Category🐳Pond/Tools

    Inputs (10)

    NameTypeDefaultDescription
    folder_pathSTRING
    modeCOMBO随机3 options: 随机, 索引, 顺序
    file_typeCOMBO自动4 options: 图像, 文本, 自动, 图像+文本
    indexINT00–99999
    seedINT-1-1–18446744073709550000
    patternSTRING*
    recursiveBOOLEANfalse
    sort_byCOMBO名称3 options: 名称, 日期, 大小
    text_modeCOMBO配对2 options: 配对, 随机
    previous_indexoptINT-1

    Outputs (6)

    NameTypeDescription
    图像IMAGE
    文本STRING
    文件名STRING
    索引INT
    文件总数INT
    元数据DICT