This repository sets up a working environment for ComfyUI, AUTOMATIC1111 Stable Diffusion WebUI, and Deforum on modal.com.
It includes pre-built images that handle downloading and saving various models — including checkpoints, LoRAs, VAEs, and ControlNets — from Huggingface and CivitAI.
- Create an account on modal.com.
- Install dependencies:
pip install -r requirements.txt
- Set up Modal CLI:
modal setup
- Download models and assets:
python download_data.py
- Launch the WebUI:
python comfyui.py # For ComfyUI python a1111.py # For AUTOMATIC1111
The config.json file defines which models to download.
To download models from CivitAI, include your CivitAI token in this file — it's required for access to CivitAI models.
If you want to add other models just add them to the config file and launch python download_data.py.
The scripts use two persistent volumes:
data: Stores models and user inputs.cache: Stores outputs and temporary files.
download_data.py: Downloads models from HuggingFace and CivitAI based onconfig.json. Data is stored on a Modal volume to avoid re-downloading.a1111.py: Sets up the AUTOMATIC1111 WebUI and installs the Deforum extension.comfyui.py: Sets up ComfyUI with custom nodes and Deforum Comfy Nodes.
Here’s a quick reference for managing data on Modal volumes:
modal volume get [OPTIONS] VOLUME_NAME REMOTE_PATH [LOCAL_DESTINATION]Example:
To download outputs to a local output/ folder:
modal volume get --force cache / output/modal volume put [OPTIONS] VOLUME_NAME LOCAL_PATH [REMOTE_PATH]Example:
To upload local input/ data to /data/input:
modal volume put --force data input/ /input