ComfyUI with RunPod: Pod Deployment + Serverless API Setup
Learn how to deploy ComfyUI on RunPod using both pod and serverless setups
This full guide covers API access, model setup, and testing with Postman and a custom web app. Includes a free app template to help you build and launch your own project easily.
Video Preview
Course Preview

Step-by-Step Guide
Complete walkthrough from setup to deployment with real examples
What You'll Learn
- โComfyUI Pod deployment on RunPod
- โServerless API setup and configuration
- โModel integration and testing
- โPostman API testing workflows
- โCustom web app development
- โProduction deployment strategies
Download Resources
ComfyUI Course Resources
Everything you need for both pod deployment and serverless API setup
Pod Version
- โComfyUI workflow files
- โHelper guide with all instructions
- โWeb app for pod version
Serverless API
- โComfyUI workflow files
- โAPI.json configuration
- โHelper doc with all instructions
- โGitHub files for endpoints
- โDocker setup (optional)
- โWeb app for serverless version
Text Guide
RunPod Pods Setup with ComfyUI โ Step-by-Step Guide
This document provides a step-by-step guide to setting up and using RunPod Pods with ComfyUI. It includes creating necessary accounts, deploying a GPU pod, installing models, and testing the system.
๐ง 1. Create Required Accounts
- RunPod โ for GPU pods and future serverless functions:
Referral link: https://runpod.io?ref=ckrxhc11
๐ Signing up and depositing $10 using this referral may grant you a one-time credit bonus between $5โ$500. - HuggingFace โ required for accessing and downloading AI models:
https://huggingface.co/ - Civitai โ used to download community models:
https://civitai.com/
๐ณ 2. Fund Your RunPod Account
Ensure you have at least $10 in your RunPod account to spin up GPU pods and receive the bonus credit (if using referral).
Referral link: https://runpod.io?ref=ckrxhc11
๐พ 3. Create Network Storage
- Go to the "Network Volumes" section in RunPod.
- Create a new volume with at least 40 GB of space.
- This will allow persistent storage between pod sessions.
โ๏ธ 4. Deploy a Pod with GPU
- From the RunPod dashboard, click "Deploy Pod".
- Select a GPU (e.g., RTX A5000 for better performance).
- Under Templates, choose: ComfyUI Manager โ Permanent Disk โ torch 2.4
- Attach your network volume during setup.
๐ 5. Launch the Environment
- Wait for the pod to fully install (may take several minutes).
- Once the pod is ready, click "Connect" > "Open in Jupyter Notebook".
- In the Jupyter interface, open the terminal and run:
๐งฑ 6. Import or Create Your Workflow
- Use drag-and-drop to import your ComfyUI workflow.
- The ComfyUI Manager interface will load automatically after executing the run script.
๐ฆ 7. Install Missing Nodes
If required, install custom ComfyUI nodes such as:
๐ง 8. Install Necessary Models
All commands below use curl and require a valid HuggingFace or Civitai token.
Replace "Your token here" with your actual token.
๐น Juggernaut XL Inpainting
Folder: models/Checkpoints/
๐น Fresh Ideas@Lady Hand_SDXL
Folder: models/Loras/
๐น 4x-UniScale Upscaler
Folder: models/Upscale_Models/
๐ 9. Collect RunPod Access Credentials
From the pod dashboard, obtain:
- RunPod API Key (for remote access or automation)
- Pod username/password (for Jupyter and SSH)
๐งช 10. Open GitHub App Repo and Test
- Open the GitHub repository for your custom app.
- Update the .env file with your API key.
- Install dependencies using the provided README.
- Run the app and verify it functions properly.
- You can also modify this app to test your own custom workflows.
๐ The following Part 2 section covers Serverless deployment which continues this setup guide. Steps 1โ8 from Part 1 remain the same. Steps 9 and 10 are replaced in Part 2.
ComfyUI Serverless Endpoint Deployment Guide
This documentation provides a complete walkthrough for setting up a serverless endpoint for ComfyUI, including model preparation, environment configuration, deployment, and testing. Two testing methods are covered: Postman and a custom web app.
โ Prerequisites
- You have followed Part 1 of this guide exactly
- A working RunPod environment (optional)
- GitHub account with private repo access
- Hugging Face account with access token
- Custom ComfyUI nodes (if applicable)
๐ Step 1: Prepare the Model Folder
- Move your model folder into the root directory of ComfyUI.
- Delete any other unnecessary folders to reduce size and clutter.
- If you made modifications to your ComfyUI, download/export your custom API and workflows.
๐ Step 2: Terminate the Pod (Optional)
- If not using the RunPod instance anymore, you can terminate the pod.
- All files are stored in Network Storage and can be accessed by the serverless endpoint.
โ๏ธ Step 3: Modify the Endpoint File
Use the official ComfyUI RunPod serverless template as a base.
๐ Step 4: Add Hugging Face Token to Dockerfile
Add your Hugging Face token to the Dockerfile for model access during deployment.
๐ธ Step 5: Create Snapshot File
- Name it as
snapshot_example.json
. - Include your custom nodes, e.g., ComfyUI-Inpaint-CropAndStitch.
- Add GitHub links to other custom nodes if needed.
โฌ๏ธ Step 6: Upload to Private GitHub Repository
- Create a private repo and push your ComfyUI files, Dockerfile, and snapshot.
- Make sure large model files are not tracked unless necessary.
โ๏ธ Step 7: Deploy as Serverless Endpoint
- Connect your GitHub repo on your runpod.
- Choose the github repo.
- Attach your network drive.
๐งช Step 8: Testing the Endpoint
Two methods available:
- Method 1: Postman
- Method 2: Custom Web App
โ ๏ธ Notes
- If you modified ComfyUI from Part 1, update your Postman and app code accordingly.
- Match API structure, input keys, and output format.
๐ Summary Checklist
Task | Status |
---|---|
Model folder cleaned and moved | โ |
Pod terminated (if unused) | โ |
Endpoint script modified | โ |
HF token added in Dockerfile | โ |
Snapshot file created | โ |
Files uploaded to private GitHub | โ |
Serverless deployed with repo + network drive | โ |
Tested with Postman and custom web app | โ |