ComfyUI-to-Python-Extension  by pydn

CLI tool for ComfyUI workflow translation to Python code

created 2 years ago
1,928 stars

Top 23.1% on sourcepulse

GitHubView on GitHub
Project Summary

This tool translates ComfyUI workflows into executable Python scripts, enabling programmatic control and batch generation for AI image creation. It targets developers and researchers seeking to automate or integrate ComfyUI pipelines into larger applications, offering a bridge between visual node-based design and Pythonic execution.

How It Works

The extension intercepts ComfyUI workflows saved in API format (JSON). It then parses these workflows, mapping each node to its corresponding Python function and dependencies. The generated Python script imports necessary ComfyUI nodes and executes them sequentially, mirroring the visual workflow's logic and data flow. This approach allows for direct execution of complex generation pipelines without requiring the ComfyUI GUI to be running.

Quick Start & Requirements

  • Install by cloning the repository into the ComfyUI/custom_nodes directory.
  • Requires Python 3.x and ComfyUI.
  • For CLI usage, install requirements with pip install -r requirements.txt.
  • ComfyUI's "Dev mode" must be enabled for the "Save (API Format)" button to appear.
  • Official documentation and examples are available within the repository.

Highlighted Details

  • Supports custom ComfyUI nodes.
  • Allows dynamic parameter changes via CLI arguments.
  • Generates standalone Python scripts for offline execution.
  • Enables batch image generation by setting a queue_size.

Maintenance & Community

The project is actively maintained, with recent updates addressing compatibility with ComfyUI changes and support for custom nodes. Community support channels are not explicitly mentioned, but issues can be submitted via GitHub.

Licensing & Compatibility

The repository lists a LICENSE file, implying a standard open-source license. Specific license details and commercial use restrictions are not detailed in the README.

Limitations & Caveats

The script's functionality is dependent on the correct implementation and compatibility of individual ComfyUI nodes, especially custom ones. If a node works in the GUI but not in the generated script, it may require debugging or a specific issue submission.

Health Check
Last commit

6 days ago

Responsiveness

1 week

Pull Requests (30d)
3
Issues (30d)
11
Star History
182 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.