npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@craftgear/extract-prompts

v3.1.0

Published

Extract ComfyUI workflow JSON and A1111 prompts from images and videos

Readme

extract-prompts

a CLI tool to extract ComfyUI workflow JSON and A1111 prompts from images and videos.

Installation

npm install -g @craftgear/extract-prompts

Usage

extract-prompts <files...> [options]

Examples

# Extract from a single image
extract-prompts image.png

# Extract from multiple files with glob patterns
extract-prompts *.png *.webm

# Pretty format output
extract-prompts *.png --pretty

# Save extracted workflows to directory
extract-prompts *.png --save ./workflows

# Save to directory with spaces (use quotes)
extract-prompts *.png --save "output directory with spaces"

# Save to input file directory (uses directory of first input file)
extract-prompts *.png --save

# Convert A1111 parameters to ComfyUI workflow format
extract-prompts a1111_image.png --convert-a1111

# Combine conversion with pretty output
extract-prompts a1111_image.png --convert-a1111 --pretty

# Quiet mode (suppress non-error output)
extract-prompts *.png --quiet

Options

  • -p, --pretty: Human-readable output format (default: JSON)
  • -s, --save [directory]: Save workflows to directory (defaults to input directory if not specified)
  • -q, --quiet: Suppress non-error output
  • --overwrite: Overwrite existing files when saving
  • --name-pattern <pattern>: File naming pattern (source|sequential|timestamp) [default: source]
  • --organize <mode>: Organize saved files (none|format|date) [default: none]
  • --convert-a1111: Convert A1111 parameters to ComfyUI workflow format

Supported Formats

Images

  • PNG
  • JPEG/JPG
  • WebP

Videos

  • MP4
  • WebM
  • MOV

Output Formats

JSON (default)

Raw JSON output with full workflow data.

Pretty (--pretty flag)

Human-readable format showing:

  • LoRA models and strengths
  • Prompts (positive/negative when detected)
  • Sampler settings (steps, CFG, scheduler, seed)
  • Model information
  • Workflow statistics

Features

  • ComfyUI Workflow Extraction: Extracts complete workflow JSON from ComfyUI-generated content
  • A1111 to ComfyUI Conversion: Convert A1111 parameters to ComfyUI workflow format with full LoRA and upscaler support
  • Prompt Detection: Intelligently identifies and extracts prompts from various node types
  • LoRA Support: Extracts LoRA models and their strengths from multiple loader formats
  • Upscaler Support: Handles hires.fix and upscaler parameters in conversions
  • Conservative Labeling: Only shows positive/negative distinction when confident
  • Batch Processing: Process multiple files at once with glob patterns
  • Flexible Output: Multiple output formats for different use cases

Supported Node Types

  • CLIPTextEncode
  • WanVideoTextEncode
  • Text Multiline
  • easy showAnything
  • KSampler / WanVideoSampler
  • Power Lora Loader (rgthree)
  • LoraTagLoader
  • Various model loaders

Examples

Basic extraction

extract-prompts generated_image.png

Pretty format with LoRA and prompt details

extract-prompts workflow.webm --pretty

Save workflows organized by date

extract-prompts *.png --save ./extracted --organize date

Save to directory with spaces

# Use quotes for directory paths with spaces
extract-prompts *.png --save "My Output Directory"
extract-prompts *.png --save 'Output Folder With Spaces'

A1111 to ComfyUI Conversion

# Convert A1111 parameters to ComfyUI workflow
extract-prompts a1111_image.png --convert-a1111

# Example with LoRA tags in A1111 prompt:
# "beautiful girl <lora:style1:0.8> <lora:character:0.6>, masterpiece"
# Will generate ComfyUI workflow with LoRA loader nodes

# Example with upscaler parameters:
# Hires.fix: true, Hires upscaler: ESRGAN_4x, Hires steps: 10, Hires denoising: 0.5
# Will generate ComfyUI workflow with upscaler nodes for 2-pass generation

License

MIT