πΎ Prompt Loop Save Image
The loop-friendly Save Image that stamps every PNG with its own prompt
- images
Render a batch of prompts and the biggest headache is bookkeeping: which image was which prompt? If you're using ComfyUI's stock Save Image node, the workflow is embedded in every PNG, but it's buried in the ComfyUI graph JSON - awkward to read, awkward to match against a 40-line prompt list. PromptLoopSaveImage fixes the matching problem by writing each image's prompt into the PNG's metadata as a flat, human-readable parameters string - the same convention AUTOMATIC1111 uses, and the one Civitai's uploader reads.
It's the save node that belongs at the end of any loop workflow from this pack. In one queue job, each image gets its own prompt embedded alongside it. Drag the PNG into a metadata viewer, or upload it to Civitai, and there's your exact prompt, no guessing.
How it works
The node doesn't reinvent image saving. It delegates to ComfyUI's core SaveImage - same file output, same output/ folder, same filename behavior - but before saving it injects an extra key into the PNG's metadata. That key is parameters, and its value is your positive prompt, optionally followed by a Negative prompt: line if you supplied one.
That parameters chunk is the A1111/Forge dialect: a single flat string rather than a node graph. It's why Civitai's generation-data auto-detection picks it up and why the prompt travels even through tools that ignore ComfyUI's own metadata. And because it delegates to the core saver, the standard ComfyUI workflow and prompt chunks still get written too - you keep the drag-back-the-workflow superpower and gain the readable prompt block.
The inputs that matter
images(required) - wire fromVAEDecode. Same as any save node.prompt(required, forced input) - the positive prompt, wired from your loop node. It's forced-input on purpose: you can't type into it, you have to connect it. That's what makes each image's metadata correct.filename_prefix(defaultPromptLoop) - handed straight to coreSaveImage, so the usual tricks work:%date:yyyy-MM-dd%tokens, and a/in the prefix makes a subfolder (runs/night1).negative_prompt(optional) - a widget or a wire. Only when it's non-empty does aNegative prompt:line get appended.
No outputs. It's an output node - the endpoint of the graph.
Installation
Same light install as the rest of the pack: no dependencies, no models, empty requirements.txt. Either ComfyUI Manager β search "ComfyUI-PromptLoop", or:
cd ComfyUI/custom_nodes
git clone https://github.com/max-dingsda/ComfyUI-PromptLoop
Then restart ComfyUI. You'll find it under the promptloop category.
Where people get burned
- It's a minimal A1111-style block, not a full one. Real A1111
parametersstrings end with a settings line -Steps: 30, Sampler: DPM++ 2M, CFG scale: 5, Seed: ...- plus resource hashes. This node writes only the prompt and the negative. Fine for "which prompt made this image," but if you want Civitai to auto-link the checkpoint and LoRAs by hash, that requires the hash lines, and this node doesn't add them. For prompt-only metadata it's great; for full auto-linking you'd reach for a beefier metadata saver. - The prompt is a required wire, not a field. Forget to connect it and the node errors before anything saves. In a loop setup the wire comes from the loop node, so this is usually a one-time hookup - but people who drag this in expecting a Save Image clone get tripped up.
- Metadata is disclosure. Every PNG now carries your exact prompt (and negative) in readable text. If you're generating things you don't want attributed to you, keep that in mind before sharing - this node makes the prompt more discoverable, not less.
- Filename prefix isn't per-prompt.
PromptLoop+ auto-counter is the default, which disambiguates files but doesn't tell you which was which - that's what the metadata is for. If you want descriptive filenames, you'll need to template them another way; this node is quiet on that front.
The honest verdict: this is the node you actually want in a loop workflow if you share to Civitai or just like knowing which prompt made which image. It's not a full metadata powerhouse, but for the "one queue job, many images" use case, the pairing of list-expansion + per-image prompt metadata is the whole point of the pack - and it works.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| prompt | STRING | β | |
| filename_prefix | STRING | PromptLoop | β |
| negative_promptopt | STRING | β |
Outputs (0)
No outputs