This repository contains everything needed to deploy a custom ComfyUI image on RunPod's serverless platform using GitHub Container Registry (GHCR).
- Custom ComfyUI Docker image with popular nodes pre-installed
- GitHub Actions workflow for automatic building and publishing to GHCR
- Support for modular node and model installation
- Ready for deployment on RunPod serverless
- ComfyUI-Manager - Node management utility
- ComfyUI_Noise - Noise generation nodes
- comfyui_controlnet_aux - ControlNet auxiliaries
- ComfyUI_IPAdapter_plus - IP-Adapter integration
- efficiency-nodes-comfyui - Efficiency enhancing nodes
- ComfyUI-Custom-Scripts - Various quality of life scripts
- stable-diffusion-webui-forge - SD WebUI Forge integration
- ControlNet Canny
- IP-Adapter Plus models
- InsightFace models
This repository includes both full and slim Dockerfile configurations. Due to GitHub Actions disk space limitations, the workflow is configured to use the slim version (Dockerfile.slim) by default. The slim version excludes large model downloads, which should be added to your RunPod network volume after deployment using the included download_models.sh script.
If you encounter build errors with "No space left on device", please see the TROUBLESHOOTING.md file for solutions.
- GitHub account
- Docker (for local testing)
- RunPod account
-
Fork/Clone this Repository
Clone this repository to your GitHub account.
-
Configure GitHub Container Registry
Make sure your repository has the necessary permissions to publish packages.
-
Build the Docker Image
The image will be built automatically by GitHub Actions when you push to the main branch or create a tag.
To build locally:
docker build -t comfyui-custom . -
Run Locally for Testing
docker-compose up
Then navigate to
http://localhost:8188in your browser. -
Deploy on RunPod
- Create a Network Volume on RunPod
- Create a Serverless Endpoint with your GHCR image:
ghcr.io/yourusername/comfyui-custom:latest - Add Container Start Command (if using custom nodes in volume):
sh -c "ln -sf /runpod-volume/custom_nodes/* /comfyui/custom_nodes && /start.sh" - Configure environment variables for S3 if needed
-
Edit the
custom_nodes.jsonfileAdd your custom nodes to the JSON file:
{ "nodes": [ { "name": "your-custom-node", "repo": "https://github.com/yourusername/your-custom-node.git", "branch": "main", "description": "Description of your node", "requirements": ["package1", "package2"] } ] } -
Rebuild the Docker Image
The next push to your repository will trigger a rebuild with your custom nodes.
For a more modular approach, use Dockerfile.modular which loads nodes and models from the custom_nodes.json file:
docker build -f Dockerfile.modular -t comfyui-custom-modular .Add models to the custom_nodes.json file under the models section:
{
"models": [
{
"name": "your-model.safetensors",
"type": "checkpoints",
"url": "https://example.com/your-model.safetensors",
"description": "Your custom model"
}
]
}- Create a Network Volume on RunPod
- Deploy it temporarily to configure
- Access the terminal and create a folder structure:
cd /workspace mkdir -p custom_nodes additional_models - Add any additional custom nodes or models that weren't included in the Docker image
- Create a new Serverless Endpoint on RunPod
- Select your desired GPU
- Use your GHCR image:
ghcr.io/yourusername/comfyui-custom:latest - Add environment variables for S3 storage if needed:
BUCKET_ENDPOINT_URL=https://bucket.s3.region.amazonaws.com BUCKET_ACCESS_KEY_ID=your-access-key BUCKET_SECRET_ACCESS_KEY=your-secret-key - Add container disk space (at least 20GB recommended)
If RunPod can't pull your image, check:
- Repository visibility settings
- Container registry credentials in RunPod
- Image tag is correct
If nodes are missing:
- Check the logs in RunPod
- Verify the node installation in the Dockerfile
- Make sure requirements are properly installed
This project is licensed under the MIT License - see the LICENSE file for details.