ComfyUI
✓ verifiedsky/comfyuiNode-based image and video generation workflows, with custom nodes and models kept on the workspace volume.
- Runs
- 1 GPU ≥ 12 GB (or CPU) · tested on L40S, A10, L4
- Image
- pytorch/pytorch:2.14.1-cuda12.6-cudnn9-runtime
- Serves
- port 8188, ready at
/system_stats(first start up to 45 min) - Licenses
- code: GPL-3.0 · notes: Model licenses vary per workflow.
- Data
library/comfyui/models/checkpoints(assets)library/comfyui/models/diffusion_models(assets)library/comfyui/models/loras(assets)library/comfyui/models/vae(assets)library/comfyui/models/text_encoders(assets)library/comfyui/models/clip_vision(assets)library/comfyui/models/controlnet(assets)library/comfyui/models/upscale_models(assets)library/comfyui/models/embeddings(assets)
Clone
Versions
| # | Status | Notes | Contents | Sealed | Published | Clones |
|---|---|---|---|---|---|---|
| v1 | Published | First-party app definition | definition only | 2026-11-22 | 2026-11-22 | 0 |
README
ComfyUI
ComfyUI is a node-based editor for image and video generation. Deployed as a workspace, everything you build up lives on a skyfs volume in your bucket and survives the GPU VM:
- custom nodes and the packages they install;
- models;
- saved workflows and settings;
- inputs and outputs.
Stop the VM when you are done. Start a new one later, on any cloud, and ComfyUI comes back exactly as you left it.
| Definition | sky-app.yaml, scripts/start.sh |
| Image | pytorch/pytorch:2.14.1-cuda12.6-cudnn9-runtime (torch 2.14.1, CUDA 12.6; NVIDIA driver ≥ 525) |
| Release | v0.45.6 (COMFYUI_REF) |
| Port | 8188, readiness /system_stats |
| GPUs | 1 by default; --app-gpus 0 runs on the CPU |
| First start | up to 45 min: image pull, ComfyUI download, requirements install |
Deploy
Prerequisites: skyws worker running against Temporal, gpuprov cloud
credentials and a bucket in ~/.skyws/config.toml
(setup).
skyws up art --app comfyui --cloud aws --gpus L40S:1 --region us-east-2
skyws open art # http://127.0.0.1:8188, over SSH; Ctrl-C to stop
skyws down art # ComfyUI exits, skyfs uploads the rest, the VM is terminated
# later, anywhere: the same name mounts the same files
skyws up art --app comfyui --cloud lambda --gpus A10:1
ComfyUI has no login, so it is never exposed on the VM's public address;
skyws open is the way in.
GPU size depends on the models you load, not on ComfyUI. 24 GB (A10, L4, RTX 4090 class) runs SDXL and Flux-schnell class workflows. 48 GB (L40S, A6000) leaves room for video models such as Wan2.2.
What is kept, and where
The app container sees the volume at /sky/volume:
| Path | What | Kept |
|---|---|---|
projects/<workspace>/custom_nodes/ |
custom nodes | yes |
projects/<workspace>/user/ |
settings, saved workflows, ComfyUI's database | yes |
projects/<workspace>/input/, output/ |
uploads and generated media | yes |
library/comfyui/models/ |
checkpoints, LoRAs, VAEs, ControlNets…, shared by every ComfyUI project on the volume | yes |
envs/comfyui-v0.45.6-py3.12-torch2.14.1+cu126/ |
the Python environment: ComfyUI's requirements and whatever custom nodes install | yes |
apps/comfyui/v0.45.6/ |
the ComfyUI release itself | yes |
library/hf/, home/ |
HF_HOME, HOME (Hugging Face downloads, dotfiles) |
yes |
/cache |
the pip cache, on the VM | no |
/scratch |
ComfyUI's temp directory, per pod | no |
ComfyUI runs with --base-directory set to the project and
--models-directory set to the shared library, so nothing it writes lands
inside the release tree.
How the template starts ComfyUI
start.sh is idempotent; each step is skipped once done:
- Release. Downloads the
COMFYUI_REFtarball and extracts it beside its final place. A single rename then moves it in, so a half-extracted release is never used. - Environment. Creates a venv over the image's packages
(
--system-site-packages), so torch comes from the image, pinned by a constraint so pip never replaces it. It uses the image's own pip (--without-pip: the image has pip but notensurepip) and installs ComfyUI's requirements. A marker file records completion. - Serve. Runs
main.pyon0.0.0.0:$APP_PORTwith the project and model directories above, and--cpuwhen the workspace has no GPU.
On a new VM only the image pull repeats. The release and the environment come back from the volume, read on demand.
Using it
Models. Use ComfyUI-Manager's model download, or put files into
library/comfyui/models/<kind>/from a shell in the app container:gpuprov ssh art -- sudo k3s kubectl -n sky exec deploy/art -c app -- \ sh -c 'cd /sky/volume/library/comfyui/models/checkpoints && curl -LO <url>'Custom nodes.
git cloneintocustom_nodes/(or use ComfyUI-Manager), then restart ComfyUI from its menu. Packages theypip installgo into the environment on the volume and come back on the next VM.Upgrading ComfyUI is manual; there is no automated upgrade (docs/app-catalog.md §8). A workspace keeps the
COMFYUI_REFit was created with. For a newer ComfyUI, create a new workspace from a definition with a newerCOMFYUI_REF, then bring your workflows, custom nodes and models across by hand, and reinstall the nodes' packages (ComfyUI-Manager's "install missing" does it). The old workspace stays as it was until you delete it.
Durability
Writes are acknowledged locally and uploaded within about a second.
skyws down stops ComfyUI first, so its database is closed, then waits for
skyfs to upload the rest and write a snapshot. If a VM disappears without a
down, the volume keeps everything up to about a second before, and is
never a mix of states.
Troubleshooting
The workflow's failure message includes the app's last log lines; the Temporal UI shows each step. On the VM:
gpuprov ssh art -- sudo k3s kubectl -n sky get pods
gpuprov ssh art -- sudo k3s kubectl -n sky logs deploy/art -c app # ComfyUI
gpuprov ssh art -- sudo k3s kubectl -n sky logs deploy/art -c skyfs # the volume
| Symptom | Cause |
|---|---|
ensurepip is not available |
A template predating --without-pip: rebuild skyws |
No such file or directory: …/custom_nodes |
A template predating the project-layout step: rebuild skyws |
keeps crashing (3 restarts) |
Read the logs in the error; fix and run skyws up again, which reuses the VM and the volume |
| Ready takes long on a first start | Image pull plus requirements install (minutes); the UI heartbeat shows the pod state |
Verified
AWS g6e.xlarge (NVIDIA L40S) in us-east-2, S3 bucket, provisioned and
removed by the workflows:
- ComfyUI 0.45.6 on
cuda:0 NVIDIA L40S, 44.4 GiB VRAM, torch 2.14.1+cu126, Python 3.12.3; - the UI served through
skyws open; - the volume after the first start: 2.6 GB (release and environment);
skyws downdrained cleanly to a final snapshot.
Not yet verified: a generation workflow, model downloads, and restore on a second cloud.
Scripts
What runs in your workspace, from definition sha256:6fd20bb0fefb2d9458c721c5879afc173d44d8f50e3ea0bfe651592d016f9329.
scripts/start.sh
#!/usr/bin/env bash
set -euo pipefail
app=$SKY_ROOT/apps/comfyui/$COMFYUI_REF
project=$SKY_ROOT/projects/$SKY_WORKSPACE
models=$SKY_ROOT/library/comfyui/models
# ComfyUI expects its base directory's layout to exist.
mkdir -p "$project"/{custom_nodes,input,output,user} "$models" "$HOME" \
"$TMPDIR/comfyui" "$(dirname "$app")"
# 1. The release: extract beside its final place, then one rename.
if [ ! -f "$app/main.py" ]; then
echo "comfyui: downloading $COMFYUI_REF"
rm -rf "$app".partial.*
tmp=$app.partial.$RANDOM
mkdir -p "$tmp"
python3 - "$COMFYUI_REF" "$tmp" <<'PY'
import io, sys, tarfile, urllib.request
ref, dest = sys.argv[1], sys.argv[2]
url = f"https://github.com/Comfy-Org/ComfyUI/archive/refs/tags/{ref}.tar.gz"
with urllib.request.urlopen(url, timeout=300) as response:
data = response.read()
with tarfile.open(fileobj=io.BytesIO(data)) as archive:
try:
archive.extractall(dest, filter="data")
except TypeError: # Python without extraction filters
archive.extractall(dest)
PY
mv "$tmp"/ComfyUI-* "$app"
rmdir "$tmp"
fi
# 2. The venv: the image's torch, plus ComfyUI's other requirements. Torch
# is pinned to the image's build, so pip never replaces it. pip is the
# image's too (`--without-pip`: images may ship pip but not ensurepip);
# run through the venv's interpreter, it installs into the venv.
key=$(python3 -c 'import sys, torch; print(f"py{sys.version_info.major}.{sys.version_info.minor}-torch{torch.__version__}")')
env=$SKY_ROOT/envs/comfyui-$COMFYUI_REF-$key
if [ ! -f "$env/.sky-complete" ]; then
echo "comfyui: building $env"
rm -rf "$env"
python3 -m venv --system-site-packages --without-pip "$env"
python3 -m pip list --format=freeze 2>/dev/null \
| grep -iE '^(torch|torchvision|torchaudio)==' > "$TMPDIR/constraints.txt" || true
"$env/bin/python" -m pip install --constraint "$TMPDIR/constraints.txt" \
-r "$app/requirements.txt"
touch "$env/.sky-complete"
fi
# 3. Serve. Everything ComfyUI writes goes to the project or the library;
# temporary files stay off the volume.
args=(--listen 0.0.0.0 --port "$APP_PORT"
--base-directory "$project" --models-directory "$models"
--temp-directory "$TMPDIR/comfyui")
if [ "${SKY_GPUS:-1}" = 0 ]; then
args+=(--cpu)
fi
cd "$app"
exec "$env/bin/python" main.py "${args[@]}"