DJZ Prompt Extractor (Batch)
Raid your whole output folder for prompts in one run
- prompts_list
- filenames_list
You know the feeling: weeks of output piling up in ComfyUI/output, and buried in there is the prompt for that one image, or a whole set of prompts you want to mine for inspiration. Dragging each PNG onto the canvas to reconstruct its workflow works, but for twenty images that's twenty graphs you have to dismiss. DJZ Prompt Extractor (Batch) is the "do it to all of them at once" version: point it at a directory, and it walks the PNGs, extracts a prompt from each, and hands you the results as text.
How it works
It's the same extraction engine as the single-image nodes, just looped. For every PNG in the directory, the node reads the file's tEXt/iTXt metadata chunks with PIL, parses the embedded workflow and prompt JSON, finds the CLIPTextEncode text fields, and classifies them into positive and negative. Then it joins the results into two text blocks so you can paste them somewhere or dump them with a Show Text node.
Inputs that matter
- directory_path - the folder to scan. This is the one you actually set. Absolute paths are the safe choice.
- max_images - cap on how many files it processes, 1–100, default 10. Raise it if you're genuinely mining a big folder; the default exists so you don't accidentally process a thousand files.
- extraction_mode -
longest_string(default),positive_only, ornegative_only. Note the smaller menu here: noall_prompts, which the single-image version has. If you need to see everything a file contains, run that file through the single-node extractor instead.
Outputs
- prompts_list - one extracted prompt per file, joined with
---separators. - filenames_list - the corresponding filenames, one per line, matching the prompt order.
Both are plain STRING outputs, so wire them into a Show Text node to read them, or into a file-saving node to keep a record. (Slightly unintuitive: they're not actual ComfyUI list types despite the names - you get one big text block each.)
Install and troubleshooting
Shared with the pack: ComfyUI Manager, search "DJZ Prompt Extractor", or:
cd ComfyUI/custom_nodes
git clone https://github.com/MushroomFleet/ComfyUI_PromptExtractor_nodes
Restart after. Zero extra dependencies, no models to download - the whole pack runs on PIL plus the standard library.
Two things bite people here. First, the same metadata caveat that applies everywhere in this pack: only original, untouched ComfyUI PNGs carry the chunks. Re-saved or uploaded images extract as nothing, and the node quietly skips files it can't read. Second, max_images - the node slices the file list by it, and it doesn't sort, so "first ten PNGs in directory order" may not be the ten you wanted. If a batch looks wrong, check the filenames list, then consider splitting the folder.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| directory_path | STRING | — | |
| max_imagesopt | INT | 101–100 | — |
| extraction_modeopt | COMBO | 3 options: longest_string, positive_only, negative_only |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| prompts_list | STRING | — |
| filenames_list | STRING | — |