General Introduction
Cog-ComfyUI is an open source project designed to run ComfyUI workflows through an API. Created by GitHub user fofr, the project provides an efficient way to integrate and run ComfyUI workflows.ComfyUI is a user interface for image generation and manipulation with support for a variety of models and custom nodes.Cog-ComfyUI runs through the Replicate platform, allowing users to quickly and efficiently in their own applications or websites integrate ComfyUI workflows.
Function List
- API Runs: Simplify the integration process by running ComfyUI workflows through the API.
- Support for multiple models: Includes popular model weights and custom nodes.
- Efficient workflow management: Supports the rapid running and management of workflows on the Replicate platform.
- Customized Node Configuration: Allows users to add and configure custom nodes as required.
- Input file management: Supports uploading input files via URL, single file upload or zip file.
Using Help
Installation and configuration
- Cloning Warehouse:
git clone --recurse-submodules https://github.com/fofr/cog-comfyui.git
- Install custom nodes:
. /scripts/install_custom_nodes.py
- Start the Cog container and expose the port:
sudo cog run -p 8188 bash
- Start the server inside the Cog container:
cd ComfyUI/ python main.py --listen 0.0.0.0
- Access the server on the local machine:
http://:8188
Using the ComfyUI API
- Get API JSON:
- exist ComfyUI Enable "Developer Mode Option" in Settings
- Load workflow and export API JSON
- Prepare the input file:
- Specify the input file using a URL
- Uploading a single input file
- Upload a zip file containing the input files
- Use the LoRA model:
- Download URLs for direct use of LoRA models
- Using the LoraLoaderFromURL node provided by ComfyUI-GlifNodes
- Run the workflow:
- Update the input file path and run the workflow
- Enable the Return Temp File option to return preprocessed control grid images
Main function operation flow
- Loading workflows::
- Access the local ComfyUI server and load the workflow_api.json or workflow_ui.json file.
- Make sure you have downloaded and placed the Stable Diffusion 3 weights file into the ComfyUI/models/checkpoints folder.
- Configuring Custom Nodes::
- Add or modify the custom node configuration in the custom_nodes.json file.
- Use the ComfyUI interface for node connections and parameter adjustments.
- Operational and management workflows::
- Run workflows on the Replicate platform and use APIs to integrate into applications or websites.
- Ensure workflows run efficiently with Replicate's production-ready API.
- Debugging and Optimization::
- Use ComfyUI's debugging tools and logging capabilities to monitor the status of workflow operations.
- Adjust model parameters and node configurations as needed to optimize generation results.