Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
32c14ae
docs: comfyui integration plan
thinmintdev Jun 16, 2026
9071cd9
fix(comfyui): model pulls target /mnt/ai-models/comfyui/models
thinmintdev Jun 16, 2026
7feb8d2
feat(comfyui): vendor fetch scripts + sdxl/esrgan
thinmintdev Jun 16, 2026
2fe04fc
feat(comfyui): Task 2.2 — capability registry with ModelVariant datac…
thinmintdev Jun 16, 2026
e2f4e35
feat(comfyui): async model fetch wrapper
thinmintdev Jun 16, 2026
4138650
feat(comfyui): curated sdxl + esrgan
thinmintdev Jun 16, 2026
89f0990
feat(comfyui): ship switchover control scripts in-repo (Task 3.1)
thinmintdev Jun 16, 2026
4c91c0e
feat(comfyui): ship extra_model_paths.yaml template
thinmintdev Jun 16, 2026
f652362
feat(comfyui): extensions-registry entry
thinmintdev Jun 16, 2026
517c4af
feat(comfyui): installer services step + repair
thinmintdev Jun 16, 2026
c391d1d
feat(comfyui): Task 3.5 — selection module + /models/fetch route + in…
thinmintdev Jun 16, 2026
9771f96
feat(comfyui): Phase 4 control routes + TDD tests
thinmintdev Jun 16, 2026
16a19bc
feat(ui): ImageGen V2 render-hero pane (mock)
thinmintdev Jun 16, 2026
c39a16e
feat(ui): wire ImageGen pane to live ComfyUI API
thinmintdev Jun 16, 2026
b95e04e
style(comfyui): ruff format + lint fixes (RUF006 bg-task ref, RUF012 …
thinmintdev Jun 16, 2026
5d3fd15
fix(#872): multi-step positional-arg fetch for kyuz0 scripts
thinmintdev Jun 17, 2026
54df0c7
fix(#872): make fetch_model non-blocking (background daemon thread)
thinmintdev Jun 17, 2026
24bddd1
docs(comfyui): Codex-targeted follow-up handoffs (#873-877, P1, 6.3)
thinmintdev Jun 17, 2026
a5d0451
fix(comfyui): drop stale Lemonade inference scripts (#876)
thinmintdev Jun 17, 2026
67c53e3
fix(comfyui): validate workflows and pin image digest (#877)
thinmintdev Jun 17, 2026
62a26b4
feat(comfyui): surface real render telemetry in status (#873)
thinmintdev Jun 17, 2026
4d77309
fix(comfyui): use slot-owned lifecycle for restart and repair (#874, …
thinmintdev Jun 17, 2026
1dd4cd2
Merge branch 'main' into feat/comfyui-platform
thinmintdev Jun 17, 2026
6d8ab8c
test(comfyui): align model-store path expectations (#877)
thinmintdev Jun 17, 2026
4205d7e
style(comfyui): format model-store path tests (#877)
thinmintdev Jun 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
287 changes: 287 additions & 0 deletions docs/superpowers/handoffs/2026-06-16-comfyui-followups.md

Large diffs are not rendered by default.

378 changes: 378 additions & 0 deletions docs/superpowers/plans/2026-06-16-comfyui-platform-integration.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions installer/comfyui/extra_model_paths.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
comfyui:
base_path: /root/comfy-models
checkpoints: checkpoints
diffusion_models: diffusion_models
unet: unet
text_encoders: text_encoders
clip: clip
clip_vision: clip_vision
vae: vae
loras: loras
controlnet: controlnet
upscale_models: upscale_models
latent_upscale_models: latent_upscale_models
embeddings: embeddings
style_models: style_models
3 changes: 3 additions & 0 deletions installer/comfyui/scripts/comfy-down.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
set -euo pipefail
docker stop comfyui >/dev/null 2>&1 && echo "[comfy-down] stopped" || echo "[comfy-down] not running"
2 changes: 2 additions & 0 deletions installer/comfyui/scripts/comfy-logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
docker logs --tail "${1:-60}" -f comfyui
14 changes: 14 additions & 0 deletions installer/comfyui/scripts/comfy-postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Reinstall custom-node Python deps into the container venv.
# WHY: node *code* lives on the mounted custom_nodes (persistent), but node *deps*
# live in the container's /opt/venv (ephemeral). After any `docker rm` + recreate
# the deps are gone and the added nodes fail to import. comfy-up.sh runs this
# automatically on a fresh create; run it by hand if you ever recreate manually
# or add nodes via the Manager UI and want them to survive a recreate.
set -uo pipefail
NAME=comfyui
if ! docker ps --format '{{.Names}}' | grep -qx "$NAME"; then
echo "[comfy-postinstall] container '$NAME' not running — start it first (comfy-up.sh)"; exit 1
fi
docker exec "$NAME" bash /root/comfy-models/.node-install.sh
echo "[comfy-postinstall] node deps reinstalled"
37 changes: 37 additions & 0 deletions installer/comfyui/scripts/comfy-up.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# Launch (or resume) the ComfyUI container on hal0 iGPU (gfx1151).
# - Image is DIGEST-PINNED for reproducibility (a re-pull can't silently change the build).
# To update: pull a new tag, then replace the @sha256 below with its RepoDigest.
# - --restart no: does NOT auto-start on boot, so it never contends with Lemonade at boot.
# (After a CT reboot, run this script to bring ComfyUI back up.)
# - On a FRESH create it self-heals node deps (which live in the ephemeral container venv).
set -euo pipefail
IMG=docker.io/kyuz0/amd-strix-halo-comfyui@sha256:0066678ae9043f69a1c8c7699e70626ceffd35c1a8ca03227a05640ad0241ed2
NAME=comfyui
ROOT=/mnt/ai-models/comfyui
if docker ps -a --format "{{.Names}}" | grep -qx "$NAME"; then
docker start "$NAME" >/dev/null && echo "[comfy-up] resumed existing container"
else
docker run -d --name "$NAME" --restart no \
--device /dev/kfd --device /dev/dri \
--group-add video --group-add render \
--security-opt apparmor=unconfined --security-opt seccomp=unconfined \
--ipc=host --shm-size=8g \
-p 8188:8188 \
-v "$ROOT/models":/root/comfy-models \
-v "$ROOT/output":/opt/ComfyUI/output \
-v "$ROOT/input":/opt/ComfyUI/input \
-v "$ROOT/user":/opt/ComfyUI/user \
-v "$ROOT/custom_nodes":/opt/ComfyUI/custom_nodes \
-v "$ROOT/extra_model_paths.yaml":/opt/ComfyUI/extra_model_paths.yaml:ro \
--entrypoint bash "$IMG" \
-lc "cd /opt/ComfyUI && exec python main.py --listen 0.0.0.0 --port 8188 --disable-mmap --bf16-vae --cache-none" >/dev/null
echo "[comfy-up] created container — waiting for it, then installing custom-node deps (fresh venv)…"
for i in $(seq 1 40); do [ "$(curl -s -o /dev/null -w "%{http_code}" http://127.0.0.1:8188/ 2>/dev/null)" = "200" ] && break; sleep 3; done
if /opt/comfyui/comfy-postinstall.sh; then
docker restart "$NAME" >/dev/null && echo "[comfy-up] node deps installed; restarted to load them"
else
echo "[comfy-up] WARN: postinstall failed — run /opt/comfyui/comfy-postinstall.sh then 'docker restart comfyui'"
fi
fi
echo "[comfy-up] ComfyUI → http://$(hostname -I | awk '{print $1}'):8188 (logs: /opt/comfyui/comfy-logs.sh)"
48 changes: 48 additions & 0 deletions installer/comfyui/scripts/get_esrgan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
# get_esrgan.sh — download ESRGAN upscale models for ComfyUI
# Targets: upscale_models/4x-UltraSharp.pth + upscale_models/RealESRGAN_x4plus.pth
# hal0 model store: /mnt/ai-models/comfyui/models
# Follows kyuz0 vendored-script conventions (curl download, dry-run).
set -euo pipefail

MODEL_DIR="${MODEL_DIR:-/mnt/ai-models/comfyui/models}"
DRY_RUN=0

for arg in "$@"; do
case "$arg" in
--dry-run) DRY_RUN=1 ;;
esac
done

if [[ "$DRY_RUN" -eq 1 ]]; then
echo "[dry-run] MODEL_DIR=$MODEL_DIR"
echo "[dry-run] Would download to:"
echo " upscale_models/ 4x-UltraSharp.pth"
echo " upscale_models/ RealESRGAN_x4plus.pth"
exit 0
fi

mkdir -p "$MODEL_DIR/upscale_models"

download_if_missing() {
local url="$1"
local dest_file="$MODEL_DIR/upscale_models/$(basename "$url")"

if [[ -f "$dest_file" ]]; then
echo "✓ Already present: $dest_file"
return
fi

echo "↓ Downloading $(basename "$url") → $dest_file"
curl -fL --progress-bar -o "$dest_file" "$url"
}

# 4x-UltraSharp (widely used ESRGAN upscale model)
download_if_missing \
"https://huggingface.co/Kim2091/4x-UltraSharp/resolve/main/4x-UltraSharp.pth"

# RealESRGAN x4plus (xinntao/Real-ESRGAN official release)
download_if_missing \
"https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth"

echo "✓ ESRGAN models ready in $MODEL_DIR/upscale_models"
136 changes: 136 additions & 0 deletions installer/comfyui/scripts/get_hunyuan15.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#!/usr/bin/env bash
# get_hunyuan15.sh (resume-friendly)
# Downloads models for ComfyUI HunyuanVideo 1.5 (T2V & I2V)
# Vendored from https://raw.githubusercontent.com/kyuz0/amd-strix-halo-comfyui-toolboxes/main/scripts/get_hunyuan15.sh
# vendored 2026-06-16 — adapted: MODEL_DIR defaults to /mnt/ai-models/comfyui/models (hal0 store)
set -euo pipefail

export HF_HUB_ENABLE_HF_TRANSFER=1
export HF_HOME="${HF_HOME:-$HOME/.cache/huggingface}"
HF="/opt/venv/bin/hf"

MODEL_DIR="${MODEL_DIR:-/mnt/ai-models/comfyui/models}"
STAGE="$MODEL_DIR/.hf_stage_hunyuan15"

# Repositories
REPO_MAIN="Comfy-Org/HunyuanVideo_1.5_repackaged"
REPO_VISION="Comfy-Org/sigclip_vision_384"

# Ensure directories exist
mkdir -p "$MODEL_DIR"/{text_encoders,vae,diffusion_models,clip_vision,latent_upscale_models,loras}
mkdir -p "$STAGE"

download_if_missing () {
local repo="$1"
local remote="$2"
local dest_path="$3"

local dest_dir="$MODEL_DIR/$dest_path"
local dest_file="$dest_dir/$(basename "$remote")"
local staged="$STAGE/$remote"

if [[ -f "$dest_file" ]]; then
echo "✓ Already present: $dest_file"
return
fi

echo "↓ Downloading $(basename "$remote") → $dest_file"
mkdir -p "$(dirname "$staged")"
mkdir -p "$dest_dir"

"$HF" download "$repo" "$remote" \
--repo-type model \
--cache-dir "$HF_HOME" \
--local-dir "$STAGE"
mv -f "$staged" "$dest_file"
}

usage() {
cat <<'USAGE'
Usage: get_hunyuan15.sh <target>

Targets:
common Text Encoders, VAE, CLIP Vision (Shared dependencies)
- text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors
- text_encoders/byt5_small_glyphxl_fp16.safetensors
- vae/hunyuanvideo15_vae_fp16.safetensors
- clip_vision/sigclip_vision_patch14_384.safetensors (Only for I2V)

720p-t2v Text-to-Video Model (FP16)
- diffusion_models/hunyuanvideo1.5_720p_t2v_fp16.safetensors

720p-i2v Image-to-Video Model (FP16)
- diffusion_models/hunyuanvideo1.5_720p_i2v_fp16.safetensors

upscale Upscaling Models (1080p SR + Latent Upsampler)
- diffusion_models/hunyuanvideo1.5_1080p_sr_distilled_fp16.safetensors
- latent_upscale_models/hunyuanvideo15_latent_upsampler_1080p.safetensors

lora HunyuanVideo 1.5 LoRAs
- loras/hunyuanvideo1.5_t2v_480p_lightx2v_4step_lora_rank_32_bf16.safetensors

all Download EVERYTHING (T2V, I2V, Upscale, LoRA, Common)

Maintenance:
clean-stage Remove staging folder (keeps final models)
clean-cache Remove Hugging Face cache (~/.cache/huggingface)

USAGE
}

case "${1:-}" in
common)
echo "==> Text Encoders, VAE, & CLIP Vision"
download_if_missing "$REPO_MAIN" "split_files/text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors" "text_encoders"
download_if_missing "$REPO_MAIN" "split_files/text_encoders/byt5_small_glyphxl_fp16.safetensors" "text_encoders"
download_if_missing "$REPO_MAIN" "split_files/vae/hunyuanvideo15_vae_fp16.safetensors" "vae"
download_if_missing "$REPO_VISION" "sigclip_vision_patch14_384.safetensors" "clip_vision"
;;

720p-t2v)
echo "==> 720p Text-to-Video Model"
download_if_missing "$REPO_MAIN" "split_files/diffusion_models/hunyuanvideo1.5_720p_t2v_fp16.safetensors" "diffusion_models"
;;

720p-i2v)
echo "==> 720p Image-to-Video Model"
download_if_missing "$REPO_MAIN" "split_files/diffusion_models/hunyuanvideo1.5_720p_i2v_fp16.safetensors" "diffusion_models"
;;

upscale)
echo "==> 1080p Upscaling Models"
download_if_missing "$REPO_MAIN" "split_files/diffusion_models/hunyuanvideo1.5_1080p_sr_distilled_fp16.safetensors" "diffusion_models"
download_if_missing "$REPO_MAIN" "split_files/latent_upscale_models/hunyuanvideo15_latent_upsampler_1080p.safetensors" "latent_upscale_models"
;;

lora)
echo "==> HunyuanVideo 1.5 LoRAs"
download_if_missing "$REPO_MAIN" "split_files/loras/hunyuanvideo1.5_t2v_480p_lightx2v_4step_lora_rank_32_bf16.safetensors" "loras"
;;

all)
echo "==> Downloading Full Suite (T2V + I2V + Upscale + LoRA)..."
"$0" common
"$0" 720p-t2v
"$0" 720p-i2v
"$0" upscale
"$0" lora
;;

clean-stage)
rm -rf "$STAGE"; echo "✓ Removed stage: $STAGE"
;;
clean-cache)
rm -rf "$HF_HOME"; echo "✓ Removed HF cache: $HF_HOME"
;;
""|-h|--help|help)
usage
;;
*)
echo "Unknown target: $1" >&2
usage
exit 1
;;
esac

echo "✓ Done."
107 changes: 107 additions & 0 deletions installer/comfyui/scripts/get_ltx2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env bash
# get_ltx2.sh (resume-friendly)
# Vendored from https://raw.githubusercontent.com/kyuz0/amd-strix-halo-comfyui-toolboxes/main/scripts/get_ltx2.sh
# vendored 2026-06-16 — adapted: MODEL_DIR defaults to /mnt/ai-models/comfyui/models (hal0 store)
set -euo pipefail

export HF_HUB_ENABLE_HF_TRANSFER=1
export HF_HOME="${HF_HOME:-$HOME/.cache/huggingface}" # persistent HF cache
HF="/opt/venv/bin/hf"

MODEL_DIR="${MODEL_DIR:-/mnt/ai-models/comfyui/models}"
STAGE="$MODEL_DIR/.hf_stage_ltx2" # persistent staging (enables resume)

mkdir -p "$MODEL_DIR"/{checkpoints,text_encoders,loras,latent_upscale_models}
mkdir -p "$STAGE"

download_if_missing () {
local repo="$1"
local remote="$2"
local dest_path="$3" # Relative path under MODEL_DIR, e.g., "text_encoders"

local dest_dir="$MODEL_DIR/$dest_path"
local dest_file="$dest_dir/$(basename "$remote")"
local staged="$STAGE/$remote"

if [[ -f "$dest_file" ]]; then
echo "✓ Already present: $dest_file"
return
fi

echo "↓ Downloading $(basename "$remote") → $dest_file"
mkdir -p "$(dirname "$staged")" # ensure stage path exists
mkdir -p "$dest_dir" # ensure dest dir exists

"$HF" download "$repo" "$remote" \
--repo-type model \
--cache-dir "$HF_HOME" \
--local-dir "$STAGE"
mv -f "$staged" "$dest_file"
}

usage() {
cat <<'USAGE'
Usage: get_ltx2.sh <target> [variant]

Targets:
common Text encoder (Gemma 3) + Spatial Upscaler
checkpoint LTX-2 19B Checkpoint (Default: BF16. Use 'fp8' as 2nd arg for FP8)
lora Distilled LoRA + Camera Control LoRA

Maintenance:
clean-stage Remove staging folder (keeps final models)
clean-cache Remove Hugging Face cache (~/.cache/huggingface)

Notes:
- Downloads RESUME automatically via persistent --cache-dir and --local-dir.
USAGE
}

case "${1:-}" in
common)
echo "==> Text Encoder + Spatial Upscaler"
# Text Encoder: Gemma 3 12B IT FP4 Mixed
download_if_missing "Comfy-Org/ltx-2" "split_files/text_encoders/gemma_3_12B_it_fp4_mixed.safetensors" "text_encoders"

# Spatial Upscaler x2
download_if_missing "Lightricks/LTX-2" "ltx-2-spatial-upscaler-x2-1.0.safetensors" "latent_upscale_models"
;;

checkpoint)
VARIANT="${2:-bf16}"
echo "==> LTX-2 19B Checkpoint ($VARIANT)"

if [[ "$VARIANT" == "fp8" ]]; then
download_if_missing "Lightricks/LTX-2" "ltx-2-19b-dev-fp8.safetensors" "checkpoints"
else
# Default / BF16
download_if_missing "Lightricks/LTX-2" "ltx-2-19b-dev.safetensors" "checkpoints"
fi
;;

lora)
echo "==> LTX-2 LoRAs"
# Distilled LoRA
download_if_missing "Lightricks/LTX-2" "ltx-2-19b-distilled-lora-384.safetensors" "loras"

# Camera Control LoRA
download_if_missing "Lightricks/LTX-2-19b-LoRA-Camera-Control-Dolly-Left" "ltx-2-19b-lora-camera-control-dolly-left.safetensors" "loras"
;;

clean-stage)
rm -rf "$STAGE"; echo "✓ Removed stage: $STAGE"
;;
clean-cache)
rm -rf "$HF_HOME"; echo "✓ Removed HF cache: $HF_HOME"
;;
""|-h|--help|help)
usage
;;
*)
echo "Unknown target: $1" >&2
usage
exit 1
;;
esac

echo "✓ Done."
Loading