ComfyUI Metadata Extractor
A ComfyUI custom node that extracts workflow metadata from PNG images and video files (MP4, AVI, MOV, MKV, WebM) generated by ComfyUI. Recover your prompts, settings, and generation parameters from any ComfyUI output!
📋 Features
- ✅ Dual format support - Extracts from both PNG images and video files
- ✅ Complete metadata extraction - Prompts, seed, steps, CFG, sampler, and more
- ✅ Multiple input methods - Dropdown selector, manual path, or tensor input
- ✅ Video format support - MP4, AVI, MOV, MKV, WebM
- ✅ Full JSON output - Access complete workflow data
- ✅ Video properties - Resolution, FPS, duration, codec info
- ✅ Easy to use - No complex configuration needed
🎯 What It Extracts
From Images (PNG)
- Positive prompt
- Negative prompt
- Seed
- Steps
- CFG scale
- Sampler name
- Full workflow JSON
- All node parameters
From Videos (MP4, etc.)
- All image metadata fields
- Video resolution (width x height)
- Frame rate (FPS)
- Duration
- Video codec
- Complete workflow data
🚀 Installation
Method 1: ComfyUI Manager (Recommended)
- Open ComfyUI Manager
- Search for "Metadata Extractor"
- Click Install
- Restart ComfyUI
Method 2: Manual Installation
-
Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/ -
Clone this repository:
git clone https://github.com/ai-joe-git/ComfyUI-Metadata-Extractor.git -
Install ffmpeg (required for video support):
Windows:
winget install ffmpegmacOS:
brew install ffmpegLinux:
sudo apt install ffmpeg # Debian/Ubuntu sudo dnf install ffmpeg # Fedora -
Restart ComfyUI
-
The node will appear as "📹 Extract Metadata (PNG/Video)" in the node menu under
utils/metadata
💡 Usage
Basic Setup
-
Add the node to your workflow
- Search for "Extract Metadata" or "📹 Extract Metadata (PNG/Video)"
-
Choose input method (pick one):
Option A: Dropdown (Easiest)
- Copy your image/video to
ComfyUI/input/folder - Select from the
filenamedropdown - No typing needed!
Option B: Manual Path
- Paste full path in
file_pathfield - Example:
C:\Users\YourName\video.mp4
Option C: Video Tensor (Limited)
- Connect Load Video output to
videoinput - Node will attempt to find source file
- ⚠️ Not as reliable - use dropdown instead
- Copy your image/video to
-
Connect outputs to Show Text nodes or use in your workflow
Example Workflow
[Extract Metadata Node]
├─ positive_prompt → [Show Text / CLIPTextEncode]
├─ negative_prompt → [Show Text]
├─ seed → [Show Text / Display Integer]
├─ steps → [Show Text / Display Integer]
├─ cfg → [Show Text / Display Float]
├─ sampler → [Show Text]
├─ metadata_json → [Show Text / Save to File]
└─ file_info → [Show Text]
📤 Outputs
The node provides 9 outputs:
| Output | Type | Description |
|---|---|---|
positive_prompt |
STRING | Your main generation prompt |
negative_prompt |
STRING | Your negative prompt |
seed |
INT | Random seed used |
steps |
INT | Number of sampling steps |
cfg |
FLOAT | CFG scale value |
sampler |
STRING | Sampler name (e.g., "euler_ancestral") |
scheduler |
STRING | Scheduler name (if available) |
metadata_json |
STRING | Complete workflow as JSON |
file_info |
STRING | Video/image properties summary |
🎨 Use Cases
Recreate Past Generations
Extract settings from an old image to reproduce the same results:
Load old image → Extract Metadata → Use settings in new workflow
Organize Your Outputs
Extract and log all generation parameters for your archive:
Extract Metadata → metadata_json → Save to database/spreadsheet
Study Successful Prompts
Analyze what worked well in previous generations:
Extract prompts from best outputs → Study patterns → Refine workflow
Batch Analysis
Process multiple files to understand your generation patterns:
For each output:
Extract Metadata → Aggregate statistics → Identify trends
🔍 Console Output
When extracting metadata, you'll see helpful debug info:
[Metadata] 📂 Processing: video.mp4
[Metadata] Video tags: ['comment', 'encoder']
[Metadata] ✅ Found 'comment' tag
[Metadata] Parsing 45 nodes...
[Metadata] ✅ Positive prompt
[Metadata] ✅ Negative prompt
[Metadata] ✅ Seed: 123456
[Metadata] ✅ Steps: 20
[Metadata] ✅ CFG: 7.5
[Metadata] ✅ Sampler: euler_ancestral
🔧 Requirements
- ComfyUI (latest version recommended)
- ffmpeg (required for video support)
- Python 3.8+ (included with ComfyUI)
- PIL/Pillow (included with ComfyUI)
⚙️ Technical Details
Supported Video Formats
- MP4 (H.264, H.265)
- AVI
- MOV
- MKV
- WebM
Metadata Sources
The node searches for ComfyUI metadata in:
- PNG:
workflowandpromptchunks - Video:
comment,description,workflowtags
Node Detection
Automatically identifies and extracts from:
CLIPTextEncode- PromptsRandomNoise- Seed valuesKSamplerSelect- Sampler namesLTXVScheduler,BasicScheduler- StepsCFGGuider- CFG scale- And many more ComfyUI nodes!
💡 Tips & Tricks
- Use the dropdown - Most reliable method for selecting files
- Copy to input folder - Makes files easily accessible via dropdown
- Check console - Detailed logging shows exactly what's being extracted
- Full JSON available -
metadata_jsonoutput contains everything - Video tensor limitations - Direct tensor input can't reliably find source files
- No metadata? - File must be generated with "Save Metadata" enabled
⚠️ Troubleshooting
"ffprobe not found" Error
- Solution: Install ffmpeg (see installation section)
- Verify: Run
ffprobe -versionin terminal
"No metadata found"
- Check: File was generated by ComfyUI with metadata enabled
- Try: Use workflow JSON export instead of direct file
- Note: Not all generators save metadata
Empty Outputs
- Reason: Metadata structure not recognized
- Solution: Check
metadata_jsonoutput for raw data - Workaround: Parse JSON manually if needed
Video Tensor Not Working
- Expected: Video tensors don't contain filename info
- Solution: Use dropdown or manual path instead
- Why: ComfyUI design limitation, not a bug
🤝 Contributing
Contributions are welcome! Areas for improvement:
- Support for more metadata formats
- Additional output formats (CSV, database, etc.)
- GUI for batch processing
- Integration with other ComfyUI tools
- Better video tensor source detection
📄 License
MIT License - Free to use in your projects!
🔗 Links
🙏 Acknowledgments
Built for the ComfyUI community to make metadata extraction simple and accessible.
Special thanks to:
- ComfyUI developers for the amazing framework
- FFmpeg project for video processing capabilities
- Community members who suggested features and improvements
Made with ❤️ for the ComfyUI community
If this node helps your workflow, please star the repository! ⭐
📸 Screenshots
Node Interface
The node provides three input options for maximum flexibility:
- filename: Dropdown selector for files in input folder
- file_path: Manual path input
- video: Direct tensor connection (limited)
Output Example
positive_prompt: "a beautiful landscape with mountains and rivers, sunset lighting"
negative_prompt: "blurry, low quality, distorted"
seed: 424242
steps: 20
cfg: 7.5
sampler: "euler_ancestral"
file_info: "1920x1080 | 24.00 FPS | 5.00s | h264"
Need help? Open an issue on GitHub or reach out to the ComfyUI community!