Extensions/FolderPack
ComfyUI Extension

FolderPack

FolderPack for ComfyUI: process every image or text prompt in a folder exactly once — resumable folder queue with image/text loaders and image, text and video savers.

By Logos-Flux·Created 2 days ago·Updated 2 days ago· 0
Logos-Flux/comfyui-folderpack
Nodes—
On cloudLocal install
Stars0
Updated2 days ago
Readme
<img src="icon.svg" width="96" alt="FolderPack icon" align="right">

FolderPack for ComfyUI

Process every image or text prompt in a folder exactly once — no seed-as-index bookkeeping, no "which 100 did I already do?".

A standalone ComfyUI node pack with six nodes:

  • Load Next Image From Folder (Queue) — FolderQueueLoadImage
  • Load Next Text Prompt From Folder (Queue) — FolderQueueLoadText
  • Save Image (Folder Queue) — FolderQueueSaveImage
  • Save Text (Folder Queue) — FolderQueueSaveText
  • Save Video (Folder Queue) — FolderQueueSaveVideo
  • Folder Queue Status / Reset — FolderQueueStatus

Install

cd ComfyUI/custom_nodes
git clone https://github.com/Logos-Flux/comfyui-folderpack.git comfyui-folderpack

Then restart ComfyUI. FolderPack requires ComfyUI 0.44.0 or newer for the full video format/codec set (including ProRes/MOV). For development, clone into ~/projects/ and symlink it into custom_nodes/ instead. Docker caveat: ComfyUI must be able to read the symlink target — if the container only bind-mounts the ComfyUI folder, clone directly into custom_nodes/comfyui-folderpack (or same-path bind-mount the projects folder).

Development happens on Forgejo; tagged public releases are mirrored to GitHub under Logos Flux.

How it works

  • Load Next Image From Folder (Queue) and Load Next Text Prompt From Folder (Queue) claim the next unprocessed file when the prompt executes, not when it is queued. Queue 100 copies of the same prompt; each run takes its own next file. The text loader reads prompt files (.txt,.md by default; extensions is configurable) and outputs their contents as a STRING for your text-encode / prompt nodes.
  • Progress lives in a per-folder ledger, .folder-queue.json (or, with ledger_location: comfy_user_folder, under user/folder-queue/). Files are tracked by relative path + size + mtime (to the second, so a copy through zip/SMB that drops sub-second timestamps doesn't requeue finished work) — never by list index — so adding, removing, renaming, or replacing files never shifts your place, and a file whose contents changed is treated as new work.
  • Save Image / Save Text / Save Video (Folder Queue) save like the core nodes, then mark the claimed file done. A run that fails before saving (OOM, error, interrupt) leaves the file unprocessed; its orphaned claim is released automatically when the next prompt runs. Text takes a STRING (txt/md/json/csv); video takes ComfyUI's native VIDEO type (e.g. from Create Video) with format/codec like core Save Video.
  • When the folder is exhausted, queued prompts stop immediately (on_exhausted: stop_prompt) instead of erroring mid-graph or saving junk.
  • Outputs keep the source filename: wire the loader's filename_no_ext into the save node's filename input. The loader also outputs status ("37/136 file.png (99 left after this)"), index, total, and remaining_after; its node title updates after each run.

Wiring

Load Next Image/Text Prompt (Queue)    Save Image/Text/Video (Folder Queue)
  image / text ──► ... your graph ... ──► images / text / video
  filename_no_ext ─────────────────► filename
  claim_id ────────────────────────► claim_id
  ledger_path ─────────────────────► ledger_path
  status ──► Show Text (optional)

Both claim_id and ledger_path must be wired — with only one, the save still happens but the file is not marked done (the save status warns about this) and the loader will hand out the same file again next run.

Example workflow

example_workflows/ contains a six-section showcase (image/text inputs to image, text, and video outputs), including the extra packs and models those processing subgraphs need.

Reprocessing / status

Add a Folder Queue Status / Reset node (it's an output node — run it alone): report progress, clear stale claims, or clear completed entries to reprocess a folder. Deleting .folder-queue.json also resets a folder. For a text prompt folder, set its extensions to match the text loader (e.g. .txt,.md); blank counts image files.

Notes

  • Claims from a second loader in the same prompt are honoured (it takes the following file). Claims expire after claim_timeout_minutes as a backstop.
  • The loader never caches (IS_CHANGED is always dirty) — a claim must come from live folder state.
  • Sort orders: natural name (a2 < a10), plain name, modified, size.

Tests

From the repo root:

python3 -m pytest tests/folder_queue -q