2026-01-18 12:24:59 +01:00
2026-01-18 12:18:01 +01:00
2026-01-18 12:18:01 +01:00
2026-01-18 12:21:47 +01:00
2026-01-18 12:18:01 +01:00

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

  1. Open ComfyUI Manager
  2. Search for "Metadata Extractor"
  3. Click Install
  4. Restart ComfyUI

Method 2: Manual Installation

  1. Navigate to your ComfyUI custom nodes directory:

    cd ComfyUI/custom_nodes/
    
  2. Clone this repository:

    git clone https://github.com/ai-joe-git/ComfyUI-Metadata-Extractor.git
    
  3. Install ffmpeg (required for video support):

    Windows:

    winget install ffmpeg
    

    macOS:

    brew install ffmpeg
    

    Linux:

    sudo apt install ffmpeg  # Debian/Ubuntu
    sudo dnf install ffmpeg  # Fedora
    
  4. Restart ComfyUI

  5. The node will appear as "📹 Extract Metadata (PNG/Video)" in the node menu under utils/metadata

💡 Usage

Basic Setup

  1. Add the node to your workflow

    • Search for "Extract Metadata" or "📹 Extract Metadata (PNG/Video)"
  2. Choose input method (pick one):

    Option A: Dropdown (Easiest)

    • Copy your image/video to ComfyUI/input/ folder
    • Select from the filename dropdown
    • No typing needed!

    Option B: Manual Path

    • Paste full path in file_path field
    • Example: C:\Users\YourName\video.mp4

    Option C: Video Tensor (Limited)

    • Connect Load Video output to video input
    • Node will attempt to find source file
    • ⚠️ Not as reliable - use dropdown instead
  3. 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: workflow and prompt chunks
  • Video: comment, description, workflow tags

Node Detection

Automatically identifies and extracts from:

  • CLIPTextEncode - Prompts
  • RandomNoise - Seed values
  • KSamplerSelect - Sampler names
  • LTXVScheduler, BasicScheduler - Steps
  • CFGGuider - CFG scale
  • And many more ComfyUI nodes!

💡 Tips & Tricks

  1. Use the dropdown - Most reliable method for selecting files
  2. Copy to input folder - Makes files easily accessible via dropdown
  3. Check console - Detailed logging shows exactly what's being extracted
  4. Full JSON available - metadata_json output contains everything
  5. Video tensor limitations - Direct tensor input can't reliably find source files
  6. No metadata? - File must be generated with "Save Metadata" enabled

⚠️ Troubleshooting

"ffprobe not found" Error

  • Solution: Install ffmpeg (see installation section)
  • Verify: Run ffprobe -version in 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_json output 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!

🙏 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!

S
Description
No description provided
Readme
898 KiB
Languages
Python 100%