ComfyScript  by Chaoses-Ib

Python library for ComfyUI workflow automation

created 2 years ago
566 stars

Top 57.7% on sourcepulse

GitHubView on GitHub
Project Summary

ComfyScript provides a Pythonic interface and library for ComfyUI, enabling programmatic control over complex generative workflows. It targets users who prefer code over GUIs, researchers needing to integrate ComfyUI into ML pipelines, and developers seeking to automate or extend ComfyUI's capabilities. The primary benefit is enhanced flexibility, reproducibility, and integration with Python ecosystems.

How It Works

ComfyScript translates ComfyUI's node-based workflows into Python code, allowing for direct execution, manipulation, and generation of workflows. It offers a runtime environment that executes these Python scripts, abstracting the underlying ComfyUI graph execution. This approach facilitates programmatic control, enabling loops, conditional logic, and seamless integration with other Python libraries, which is a significant advantage over manual graph construction.

Quick Start & Requirements

Installation involves cloning the repository into ComfyUI's custom_nodes directory and installing dependencies via pip install -e ".[default]". Alternatively, ComfyUI can be installed as a Python package, and ComfyScript installed via pip install -U "comfy-script[default]". Python 3.12 is recommended.

Highlighted Details

  • Transpiler: Automatically converts existing ComfyUI workflows (saved as JSON or image metadata) into ComfyScript Python code.
  • Runtime: Allows direct execution of ComfyScript code, enabling programmatic workflow generation, parameter tuning, and integration with Python logic.
  • Type Stubs: Generates Python type stubs for enhanced IDE support, autocompletion, and code validation.
  • Asynchronous Execution: Supports queuing multiple tasks and provides control functions for managing the execution queue.

Maintenance & Community

The project is actively maintained by Chaoses-Ib. Community interaction and support can be found via the project's GitHub repository.

Licensing & Compatibility

The repository's license is not explicitly stated in the provided README. Users should verify licensing for commercial use or integration with closed-source projects.

Limitations & Caveats

The README mentions potential bugs in specific integrations like comfyui-photoshop and notes that some features might require manual activation or troubleshooting, particularly regarding type stub functionality in certain IDEs. The license status requires clarification.

Health Check
Last commit

1 month ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.