Use when generating video clips with MiniMax-H3 (open weights) in ComfyUI on a Google Colab GPU from your own machine — setting up the Colab session, models and tunnel, writing an H3 Ref2VA / I2VA prompt, choosing size, length and seed, queuing several clips, or keeping Colab compute costs under control.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of H3 Colab?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hieudvu-h3-colab)
---
name: h3-colab
description: Use when generating video clips with MiniMax-H3 (open weights) in ComfyUI on a Google Colab GPU from your own machine — setting up the Colab session, models and tunnel, writing an H3 Ref2VA / I2VA prompt, choosing size, length and seed, queuing several clips, or keeping Colab compute costs under control.
---
# MiniMax-H3 on Colab (ComfyUI, driven from your machine)
H3 takes up to 9 reference pictures (characters, places, a style frame) plus a structured prompt and returns a clip
with sound. This skill runs it in ComfyUI on a rented Colab GPU and drives it over an ssh tunnel: no notebook, no
ComfyUI UI. A 480p, 5 s clip with the turbo LoRA takes about 3 minutes on an L4.
## Setup (once)
1. `uv tool install google-colab-cli`, then run any `colab` command and sign in with your Google account.
You need Colab compute units (Pro / Pro+ or pay-as-you-go). **Never run `colab pay` or buy units on the user's
behalf**: if the balance is empty, stop and tell the user.
2. `ssh` must be on PATH. Nothing else to install locally: `scripts/h3_colab.py` uses the Python standard library.
## Run
```bash
python scripts/h3_colab.py run jobs.json
```
That one command: allocates a GPU (A100 first, then L4, retrying ~15 min if both are sold out) → installs ComfyUI and
downloads the H3 models (~10 min the first time; `scripts/remote/setup.sh`) → starts ComfyUI → opens a tunnel to
`127.0.0.1:18188` → runs every job in order → downloads `takes/<id>_<seed>.mp4` + a line in `takes/log.csv` →
**always stops the VM**, also on errors or Ctrl-C.
`jobs.json`:
```json
{"jobs": [
{"id": "s01", "prompt_file": "prompts/s01.txt", "refs": ["refs/hale_sheet.png", "refs/office.png", "refs/style.png"],
"seconds": 5, "size": "480x864", "seed": 1234},
{"id": "s02", "prompt_file": "prompts/s02.txt", "first_frame": "frames/s01_last.png", "seconds": 4}
]}
```
- `refs` → Ref2VA (reference to video). `first_frame` instead → I2VA (the clip starts on that exact frame; use it
to continue a picked take from its last frame).
- No `seed` → a random one, written into the file name and log so a keeper can be re-rendered.
By hand, for debugging: `up`, `setup`, `tunnel` (leave running), `gen --prompt-file ... --ref ... --out x.mp4`,
then **`down`**. Check with `status` (= `colab sessions`) that nothing of yours is left running.
## Size, length, steps
- Length must be **17k+5 frames at 24 fps**: the script rounds `seconds` up to the next valid length (5 s → 124 frames, 5.5 s → 141, 6 s → 158).
- Draft at **480×864** (vertical) or 864×480. 480p softens distant faces: pick a take, then re-render it at
**768×1344 with the same seed** (≈ 10–12 min on an L4).
- Turbo LoRA, 8 steps, `res_multistep` + `simple`: in our tests as good as 20 base steps, and it follows the prompt
better. The script always uses it.
- On an A100 (≥ 39 GB) `setup.sh` loads the non-pruned DiT (better detail); on an L4 the pruned one.
| Config (L4) | Per clip |
|---|---|
| 480p, 5 s, turbo 8 steps | ~3 min |
| 480p, 6.6 s, turbo | ~4 min |
| 768×1344, 5–6 s, turbo | ~10–12 min |
L4 ≈ 2.3 compute units/hour; 20 clips at 480p ≈ 1 hour of GPU.
## Colab rules
- One GPU session per account. If `colab new` fails with "precondition", another session holds the slot: show the
user `colab sessions`, and **never stop a session this script didn't create**.
- An idle VM keeps billing. Every run must end with the session stopped; `down` verifies and fails loudly.
- A100 / L4 can be sold out for a while; the script retries, then gives up.
## Writing the H3 prompt
Follow MiniMax's official H3 prompt-writing skill (github.com/MiniMax-AI/MiniMax-H3, `.claude/skills/h3-prompt-writing`).
Ref2VA prompts have six sections in this order: `subject_definitions`, `summary`, `retention_analysis`,
`detailed_description`, `overall_soundscape`, `non_diegetic_music`. Pictures are cited as `<Picture N>` in the order of
`refs`. What mattered most in our tests:
- **Detail wins.** A 350–500-word `detailed_description` (per shot: composition, who is where, light, the action beat
by beat, the camera, the sound) followed action and camera far better than a short one, same seed.
- **Every picture gets a label and a line.** One `subject_definitions` line per character/place, with a fixed identity
description pasted identically into every clip. Retention: characters `fully_preserved`, places
`partially_preserved`, the style frame `attribute_transfer`.
- If a ref is a character turnaround sheet, add: *"The pictures are design sheets: use them for identity only; never
reproduce several views side by side, the sheet layout or its plain background."* Otherwise H3 may copy the layout.
- **Start state**: the first shot starts exactly on the keyframe, and nothing appears that isn't in the pictures. If the
text names a prop the pictures lack, H3 invents it.
- **Camera**: write "type + amplitude + speed" in H3's vocabulary: push in, truck, pedestal, arc shot, zoom.
Translations (push, truck, pedestal, zoom) work; dolly zoom was ignored, and pure pan was ignored with a short prompt but worked with a detailed one; arcs overshoot and
invent set pieces; a big pull-out invents everything outside the frame. A move toward something not in the keyframe
is ignored. Don't put a crash zoom at 0 s: hold first, then burst.
- **The closing-frame line decides the camera.** If the last line describes the same framing ("slightly closer"), the
camera barely moves. Name a clearly different closing framing.
- Several shots in one clip work: `[Shot 1] ...` then `[Shot 2] At 00:02.500, the shot cuts to ...`.
- End `detailed_description` with: no on-screen text, no subtitles, no logos, no split screen.
- Close-ups of faces and props come out best; wide shots with many people are the weakest.
## Reviewing takes
- A broken take (a moustache that grows into a beard, people vanishing mid-move) may be the seed. **Re-roll once with
a fresh seed before rewriting the prompt.**
- Look at a contact sheet instead of opening every mp4:
`ffmpeg -i take.mp4 -vf "fps=8/5,scale=400:-1,tile=4x2" -frames:v 1 sheet.jpg`.
- Measure camera motion (optical flow) rather than trusting your eyes; see the `zelva-animated` skill, "Measure it".
## Files
- `scripts/h3_colab.py`: session control, ComfyUI client, the H3 workflow (API format), job runner.
- `scripts/remote/setup.sh`: runs on the VM; clones ComfyUI, picks int8/fp8 by CUDA version and the DiT by VRAM,
downloads from `Comfy-Org/MiniMax-H3` and `lightx2v/Minimax-h3-Turbo` with `hf download`. Idempotent.
- `scripts/remote/start.sh`: starts ComfyUI on the VM's 127.0.0.1:8188 and waits until it answers.