Comfy-Pack: Package and Deploy ComfyUI Workflow
A comprehensive toolkit for reliably packing and unpacking environments for ComfyUI workflows.
- 📦 Pack workflow environments as an artifact: Saves the workflow environment in a
.cpack.zipartifact with Python package versions, ComfyUI and custom node revisions, and model hashes. - ✨ Unpack artifact to recreate workflow environments Unpacks the
.cpack.zipartifact to recreate the same environment with the exact Python package versions, ComfyUI and custom node revisions, and model weights. - 🚀 Deploy workflow as an API: Deploys the workflow as a RESTful API with customizable input and output parameters.
Motivations
We learned from our community that packaging and sharing a ComfyUI workflow is currently difficult due to challenges in reliably replicating the workflow environment. To reliably replicate a workflow elsewhere, one must recreate the environment with the exact python packages, custom nodes revisions, and the identical models. This process can be tedious, error-prone, and time-consuming.
To address this, we built comfy-pack – a tool designed to simplify this process. As a ComfyUI Manager plugin, comfy-pack lets you package an entire workflow with just one click in the UI. Behind the scenes, it automatically locks and records everything you need: Python package versions, custom node revisions, model hashes, and any static assets required for the workflow. All of this is saved into a single .cpack.zip artifact.
The same environment can be recreated by unpacking the .cpack.zip artifact with a simple command:
comfy-pack unpack workflow.cpack.zip
Once this command completes, the environment is fully set up to reliably reproduce the original workflow.
Quick Start
Installation
Search comfy-pack in ComfyUI Manager (Recommended)
or install from Git:
git clone https://github.com/bentoml/comfy-pack.git
Pack a ComfyUI workflow
- Click "Package" button to create
.cpack.zip - (Optional) select the models that you want to include (only model hash will be recorded)
Unpack a ComfyUI workflow
# Restore a ComfyUI project from cpack files.
comfy-pack unpack workflow.cpack.zip --dir ./
Deploy a workflow as an API
3. (Optional) pack & run anywhere
# Get the workflow input spec
comfy-pack run workflow.cpack.zip --help
# Run
comfy-pack run workflow.cpack.zip --src-image image.png --video video.mp4
Parameter Nodes
ComfyPack provides custom nodes for standardizing inputs:
- ImageInput: provides
imagetype input, similar to officialLoadImagenode - StringInput: provides
stringtype input, nice for prompts - IntInput: provides
inttype input, suitable for size or seeds - AnyInput: provides
combotype and more input, suitable for custom nodes - ImageOutput: takes
imagetype inputs, similar to officialSaveImagenode, take an image of a bunch of images - FileOutput: takes file path as
stringtype, save and output the file under that path - ...
These nodes help define clear interfaces for your workflow.
Docker Support
Under development
Examples
Check our examples folder for:
- Basic workflow packaging
- Parameter configuration
- API integration
- Docker deployment
License
MIT License
Community
- Issues & Feature Requests: GitHub Issues
- Questions & Discussion: Discord Server
Detailed documentation: under development