๐ŸŽ“ Free Course + Template

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.

ComfyUIRunPodAPI SetupFree TemplateServerless

Video Preview

Course Preview

ComfyUI 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

๐Ÿ“ฆ COMPLETE COURSE

ComfyUI Course Resources

Everything you need for both pod deployment and serverless API setup

๐Ÿ“ฆ PART 1

Pod Version

  • โœ“ComfyUI workflow files
  • โœ“Helper guide with all instructions
  • โœ“Web app for pod version
๐Ÿš€ PART 2

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

๐Ÿ“ฆ PART 1

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

  1. From the RunPod dashboard, click "Deploy Pod".
  2. Select a GPU (e.g., RTX A5000 for better performance).
  3. Under Templates, choose: ComfyUI Manager โ€“ Permanent Disk โ€“ torch 2.4
  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:
./run_gpu.sh

๐Ÿงฑ 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/

curl -L -o model.safetensors -H "Authorization: Bearer Your api " "https://civitai.com/api/download/models/456538?type=Model&format=SafeTensor&size=pruned&fp=fp16"

๐Ÿ”น Fresh Ideas@Lady Hand_SDXL

Folder: models/Loras/

curl -L -o lady.safetensors -H "Authorization: Bearer Your api" "https://civitai.com/api/download/models/550216?type=Model&format=SafeTensor"

๐Ÿ”น 4x-UniScale Upscaler

Folder: models/Upscale_Models/

curl -L -o 7200.pth -H "Authorization: Bearer Your api" "https://huggingface.co/datasets/mpiquero/Upscalers/resolve/main/4x-UniScale-Balanced%20%5B72000g%5D.pth"

๐Ÿ”‘ 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.

๐Ÿš€ 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

TaskStatus
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โœ