MiniMax DGX-Spark (Music3 + H3) via ComfyUI
Generate AI music (Music3) and AI video (H3) by submitting ComfyUI API
workflows, then post-process outputs (MP3 / MP4). All paths/hosts are ENV-driven;
nothing personal is hardcoded. This skill drives the sibling scripts in the
MiniMax-DGX-Spark package (or standalone files on the node).
Prereqs
- A reachable ComfyUI instance.
- Local:
curl -s http://127.0.0.1:8188/system_stats - Remote node (e.g. a DGX Spark):
curl -s http://<NODE_IP>:8188/system_stats
- Local:
ffmpeg,python3, and (for H3) no extra GPU beyond ComfyUI's.
Set the target once per session:
export COMFY_HOST="http://<NODE_IP>:8188" # or leave unset for localhost:8188
export COMFY_OUTPUT_DIR="..." # where ComfyUI writes outputs (node-local fs)
Speak in IPs, never hostnames
If remoting to a node, use its IP in COMFY_HOST. Hostnames in SSH config are
connection aliases only. 127.0.0.1 works from inside the node.
Music3 (text-to-music)
Generate a track (MP3 default)
python3 music3/generate.py \
--caption "Hard-hitting trap rap beat, aggressive 808 bass, tight hi-hats, melodic piano" \
--lyrics "[intro]\nLet's go\n[verse 1]\nDigital rhythm sharp through the night\n[chorus]\nUnleash the spark, reaching new heights" \
--duration 35.0 --prefix my_track --format mp3
--format mp3is the default. Add--format allfor an MP4 waveform video.- Keep
--duration ≤ 35.0swhen co-tenant with a large LLM. - For max fidelity, switch
unet_nametominimax_music3_dit_fp16.safetensors(default is int8).
Bypass the app (direct API, no app dependency)
If you only have the running ComfyUI and the checkpoint files, submit the raw
API graph directly (see music3/workflows/*.json for the exact node wiring).
The canonical pipeline:
CLIPLoader (int8 TE) → UNETLoader (int8 DiT) → VAELoader (dav) →
MiniMaxMusic3TextEncode (caption/lyrics/duration/cfg/topk) →
EmptyMiniMaxMusic3LatentAudio → ConditioningZeroOut →
KSampler (euler/simple, cfg 1.0) → VAEDecodeAudio → SaveAudio.
H3 (text/image-to-video)
Generate a short clip
python3 h3/generate-video.py --prompt "a calm ocean wave at dusk, photorealistic" \
--duration 5 --prefix my_clip --host "$COMFY_HOST"
--durationis rounded UP to H3's17n+5frame grid.- Add
--reference <img-in-comfy-input>(repeatable) for identity/stability across shots. - Timings: a 5s 720p clip is ~7–8 min under heavy co-tenant load on GB10; much faster standalone.
Convert / Watchdog
- Convert a FLAC:
python3 scripts/convert-media.py out.flac --mp3(or--mp4). - Long generations that could outlive an SSH session: submit, then run detached:
nohup python3 scripts/convert-watchdog.py --prompt-id <ID> --host "$COMFY_HOST" --format mp3 > /tmp/watchdog.log 2>&1 &
The watchdog polls /history/<ID> and converts when done, surviving disconnects.
⚠️ If you get a FLAC but no MP3/MP4, the generation SUCCEEDED — the post-processing step did not. Post-processing runs client-side, so a disconnected/timed-out session yields the ComfyUI output (FLAC) but the conversion never ran. Do NOT resubmit. Run the watchdog or convert manually:
python3 scripts/convert-watchdog.py --prompt-id <ID> --format mp3. The prompt ID is printed on success (or fetch it from$COMFY_HOST/queue).
Pitfalls
- Get the prompt ID —
generate*.pyprints it on success. If the client died before doing so, fetchcurl -s "$COMFY_HOST/queue". - Do not start a second ComfyUI — check
scripts/status-comfyui.sh/curl .../queuefirst; reuse a live instance. - Audio ownership — a
<video>is muted; sound ships as separate<audio>(for HyperFrames muxing). - GP10 UMA:
nvidia-smiCSV returns[N/A]for memory; read/proc/driver/nvidia/gpus/0/memoryorsystem_statsvram_*. - Never interrupt a running ComfyUI job — wait for the queue to drain; kills orphan the job server-side.