mAi: #2 - phase 1 PoC: ComfyUI on mRock + first FLUX schnell image

Native systemd install (matches Ollama pattern on Arch — Docker on mRock
has no nvidia runtime; native venv via uv is the lighter path). The
Black-Forest-Labs FLUX.1-schnell HF repo is gated, so the download script
points at ungated mirrors (Comfy-Org/flux1-schnell + sirorable/flux-ae-vae)
that ship the same Apache-2.0 weights.

First image — cat in a fishbowl, 1024x1024, 4 steps — generated end-to-end
in 9.79s via curl + workflow JSON; stored at
/home/m/dev/ImaGen/poc/first-image.png on mRiver (not committed; transient
PoC artefact). Go adapter is phase 2.
This commit is contained in:
mAi
2026-05-08 16:50:16 +02:00
parent 20490913c1
commit a24ac2826f
5 changed files with 330 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
#!/bin/bash
# Download FLUX.1 schnell + accompanying VAE/text encoders into a ComfyUI tree.
# Uses ungated mirrors — the official Black-Forest-Labs repo is gated and
# requires an HF token. See docs/setup-comfyui-mrock.md.
set -euo pipefail
ROOT="${1:-$HOME/dev/comfyui/models}"
if [ ! -d "$ROOT" ]; then
echo "models root $ROOT does not exist — pass it as the first argument" >&2
exit 1
fi
mkdir -p "$ROOT/unet" "$ROOT/vae" "$ROOT/clip"
CKPT="https://huggingface.co/Comfy-Org/flux1-schnell/resolve/main/flux1-schnell.safetensors"
VAE="https://huggingface.co/sirorable/flux-ae-vae/resolve/main/ae.safetensors"
CLIP_L="https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors"
T5="https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp8_e4m3fn.safetensors"
dl() {
local url=$1 dest=$2
if [ -s "$dest" ]; then
echo "skip $dest (already present)"
return
fi
echo "downloading $url -> $dest"
curl -L --fail --retry 3 --retry-delay 5 -C - -o "$dest" "$url"
}
dl "$CKPT" "$ROOT/unet/flux1-schnell.safetensors"
dl "$VAE" "$ROOT/vae/ae.safetensors"
dl "$CLIP_L" "$ROOT/clip/clip_l.safetensors"
dl "$T5" "$ROOT/clip/t5xxl_fp8_e4m3fn.safetensors"
echo "done"