Skip to content
Projects

caru-ini/modal-comfyui has 54 GitHub stars and 12 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 23:43 UTC. Last push 2026-10-31.

How these counts are measured

What you can do

  • Auto-scaling: Scales down to zero when not in use to save costs.
  • GPU Snapshots: Fast startup times using Modal's GPU snapshots.
  • Model Caching: Uses Modal Volumes to cache models across runs.
  • Custom Node Management: Integrated with comfy-cli for easy plugin installation.

Measured star growth

in 24h
0
in 7 days
Update delayed
in 15 days
Update delayed
in 1 month
Update delayed

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

About

Run ComfyUI on Modal with auto-scaling, GPU snapshots, and easy model management. Try image, video generation via ComfyUI on Modal.

Creative & Media

README.md

Original

modal-comfyui

Run ComfyUI on Modal with auto-scaling, GPU snapshots, and easy model management.

Good for testing wan2.2 or other video generation models.

Prerequisites

  • A Modal account
  • Python installed
  • uv installed

Installation

  1. Clone this repository.
  2. Install the Modal client:
    uv sync
    
  3. Set up your modal account (if not done already):
    modal setup
    
  4. Set up your modal secret (optional; recommended)
    modal secret create huggingface-secret HF_TOKEN=hf_[your HF access token]
    

Configuration

Models

Copy models.example.py to models.py and edit it to manage your models. You can specify:

  • Hugging Face models(models) using repo_id and filename.
  • External models(models_ext, e.g. civitai) using a direct url.

Models are downloaded to volumes and symlinked to the specified model_dir.

model_dir accepts two styles:

  • Relative path (recommended for standard ComfyUI folders): resolved under /root/comfy/ComfyUI/models/. e.g. "checkpoints" → /root/comfy/ComfyUI/models/checkpoints.
  • Absolute path: used as-is. Use this when the target lives outside ComfyUI/models/ (e.g. a custom node's own model directory).

See models.example.py for reference.

Plugins and Custom Nodes

Copy plugins.example.py to plugins.py.

  • Workflow Dependencies: If you have a workflow_api.json in the root directory, the setup will automatically install the necessary custom nodes for that workflow, including nodes inside subgraphs. Nodes are found by the registry ID (cnr_id) that ComfyUI records in the workflow.
  • Manual additions: If some custom nodes are still missing, add their IDs to plugins.py.

In case of Insufficient Custom Node

Open ComfyUI manager on comfyui and click "Used in Workflow" to see which custom nodes are used in the workflow.

Add these custom nodes to plugins.py(be careful of node id).

Usage

Serve (Development)

Run the following command to start ComfyUI in development mode:

modal serve comfyui.py

This will provide a temporary URL where you can access the ComfyUI interface.

Deploy (Production)

To deploy ComfyUI as a persistent app:

modal deploy comfyui.py

Features

  • Auto-scaling: Scales down to zero when not in use to save costs.
  • GPU Snapshots: Fast startup times using Modal's GPU snapshots.
  • Model Caching: Uses Modal Volumes to cache models across runs.
  • Custom Node Management: Integrated with comfy-cli for easy plugin installation.

Contributing

Please feel free to contribute to make this project better. Performance improvements/optimizations are very welcome.