πΉ Extract Metadata (PNG/Video)
Stop dragging PNGs back in β pull the prompt, seed, and settings out of your old ComfyUI images (and videos)
- video
- positive_prompt
- negative_prompt
- seed
- steps
- cfg
- sampler
- scheduler
- metadata_json
- file_info
Every ComfyUI output PNG carries its whole generation history inside it - the prompt graph is embedded in the file's tEXt chunks, which is exactly why "drag the image back into ComfyUI" works as a workflow-recovery move. Extract Metadata (PNG/Video) from the ComfyUI-Metadata-Extractor pack is the version of that trick you can wire into a graph: instead of dragging an image onto the canvas and reconstructing nodes, it hands you the positive prompt, negative prompt, seed, steps, CFG, sampler, and scheduler as discrete outputs you can feed anywhere.
That's genuinely handy in three situations: you want to re-run an old generation with one tweaked setting, you're cataloging a folder of outputs into a spreadsheet, or you generated a video and want the settings back - video metadata lives in the container tags, and dragging an MP4 back in is nowhere near as smooth as it is for PNGs. For videos, this node earns its keep.
How it works
Point it at a file and it does two stages. First, the read: PNGs are opened with Pillow and the prompt / workflow JSON is pulled out of the image info; videos are handed to ffprobe, which reads the metadata tags plus width, height, FPS, and duration. Then the parse: it walks the prompt graph node by node, spotting CLIPTextEncode (first one = positive, second = negative), RandomNoise for the seed, KSamplerSelect for the sampler, and the scheduler/guider nodes for steps and CFG.
The three inputs are all optional, so you pick one way to say where the file is: filename (a dropdown of files in your ComfyUI input folder - yes, input, the README's claim that it's the output folder is wrong), file_path (a full path to anything on disk), or video (see the trap below).
The outputs that matter
Nine outputs, but really you care about four:
positive_prompt/negative_prompt- the actual text, ready to re-inject or log.metadata_json- the full raw metadata dump. This is the honest output; the others are conveniences derived from it.file_info- resolution, FPS, and duration for video, or just "PNG Image" for a still.
seed, steps, cfg, sampler, and scheduler are the reason you installed it, but here's where people get burned: the parser only understands the newer ComfyUI sampling architecture (RandomNoise + KSamplerSelect + scheduler/guider nodes - the kind LTX-Video and native advanced workflows use). A classic KSampler stores steps, CFG, sampler, and scheduler in its own inputs, which this node never reads. So feed it a typical older PNG and you'll get clean prompts but seed: 0, steps: 0, cfg: 0.0 and empty sampler/scheduler. The data is still in metadata_json - that's why that output exists.
Install
The pack is small and has no model downloads. Via ComfyUI Manager, search "Metadata Extractor" and install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/ai-joe-git/ComfyUI-Metadata-Extractor.git
cd ComfyUI-Metadata-Extractor
pip install -r requirements.txt
Then restart ComfyUI. Note that requirements.txt lists mutagen, but the code never imports it - for PNGs, Pillow (which ComfyUI already ships) is all that's used. For video support the real dependency is system-wide ffmpeg, since the node shells out to ffprobe:
# Linux
sudo apt-get install ffmpeg
# macOS
brew install ffmpeg
# Windows: choco install ffmpeg
Troubleshooting
ffprobe not found/ empty video results - ffmpeg isn't installed or isn't on your PATH. Install it and restart.- "No metadata found" - the file wasn't generated by ComfyUI, or its metadata was stripped. Image hosts (Discord, X/Twitter, most sites) routinely strip PNG
tEXtchunks, so a downloaded image often has nothing left to find. - Zeroed seed/steps/cfg - your source workflow used a plain
KSampler, which this parser skips (see above). Readmetadata_json. - The
videoinput grabs the wrong file - it's typed IMAGE but isn't actually read; passing any tensor just triggers a search for the most recently modified video in your input/output folders. If you have more than one video lying around, usefile_pathinstead.
It's a small, scrappy utility - the "Improved" in the name is doing some heavy lifting given the classic-KSampler blind spot - but for pulling prompts out of your own PNG library or recovering settings from ComfyUI video output, it does the one job nobody else in a graph does.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| videoopt | IMAGE | β | |
| file_pathopt | STRING | β | |
| filenameopt | COMBO | 2 options: , example.png |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| positive_prompt | STRING | β |
| negative_prompt | STRING | β |
| seed | INT | β |
| steps | INT | β |
| cfg | FLOAT | β |
| sampler | STRING | β |
| scheduler | STRING | β |
| metadata_json | STRING | β |
| file_info | STRING | β |