diff --git a/skill/SKILL.md b/skill/SKILL.md index a6c3ee8..5c7c3cf 100644 --- a/skill/SKILL.md +++ b/skill/SKILL.md @@ -117,7 +117,9 @@ mmx image generate --prompt "Logo" --n 3 --out-dir ./gen/ --quiet ### video generate -Generate video. Default model: `MiniMax-Hailuo-2.3`. Select `MiniMax-H3` to use the Video Generation V2 multimodal API. This is an async task — by default it polls until completion. +Generate video. Default model: `MiniMax-Hailuo-2.3` (or `MiniMax-Hailuo-2.3-Fast` for fast mode with `--image`). This is an async task — by default it polls until completion. + +For `MiniMax-H3` — text-to-video, first/last-frame, multimodal reference image/video/audio generation, prompt construction, and failure handling — use the dedicated [mmx-h3-video skill](h3-video/SKILL.md) instead. ```bash mmx video generate --prompt [flags] @@ -126,14 +128,9 @@ mmx video generate --prompt [flags] | Flag | Type | Description | |---|---|---| | `--prompt ` | string, **required** | Video description | -| `--model ` | string | `MiniMax-Hailuo-2.3` (default), `MiniMax-Hailuo-2.3-Fast`, or `MiniMax-H3` | +| `--model ` | string | `MiniMax-Hailuo-2.3` (default) or `MiniMax-Hailuo-2.3-Fast` | | `--image ` | string | Input image for image-to-video | -| `--last-frame ` | string | Last frame image; H3 supports last-frame-only input | -| `--reference-image ` | string, repeatable | H3 reference image | -| `--reference-video ` | string, repeatable | H3 reference video | -| `--reference-audio ` | string, repeatable | H3 reference audio; requires a reference image or video | -| `--duration ` | number | H3 duration, 4-15 seconds (default: 5) | -| `--ratio ` | string | H3 output ratio; T2V cannot use `adaptive` | +| `--last-frame ` | string | Optional ending image for frame interpolation (used with `--image`) | | `--callback-url ` | string | Webhook URL for completion | | `--download ` | string | Save video to specific file | | `--async` | boolean | Return task ID immediately | @@ -145,18 +142,6 @@ mmx video generate --prompt [flags] mmx video generate --prompt "A robot." --async --quiet # stdout: {"taskId":"..."} -# H3 text-to-video -mmx video generate --model MiniMax-H3 --prompt "Ocean waves." --async --quiet - -# H3 image-to-video -mmx video generate --model MiniMax-H3 --prompt "The subject walks forward." \ - --image start.jpg --async --quiet - -# H3 reference-to-video -mmx video generate --model MiniMax-H3 --prompt "Keep the same character." \ - --reference-image character.png \ - --reference-video motion.mp4 --async --quiet - # Blocking: wait and get file path mmx video generate --prompt "Ocean waves." --download ocean.mp4 --quiet # stdout: ocean.mp4 diff --git a/skill/h3-video/SKILL.md b/skill/h3-video/SKILL.md new file mode 100644 index 0000000..273a92e --- /dev/null +++ b/skill/h3-video/SKILL.md @@ -0,0 +1,221 @@ +--- +name: mmx-h3-video +description: Generate, monitor, and download MiniMax-H3 videos through the mmx CLI. Use for H3 text-to-video, first/last-frame video, multimodal reference image/video/audio generation, H3 prompt improvement, media preflight, Pay-as-you-go API key selection, task waiting, downloads, and H3 failure handling. +--- + +# MiniMax-H3 Video With MMX + +Use this skill only for `MiniMax-H3` video generation. Do not handle text, image generation, speech, music, search, legacy Hailuo models, or unrelated MMX commands. + +Before a paid request, read `references/h3-video.md` for prompt construction, media constraints, waiting behavior, and failure handling. + +## Required Rules + +1. Use a Pay-as-you-go/Credit API Key. H3 does not use OAuth or Token Plan Subscription Keys. +2. Reuse a saved MMX API key when available. Never print, repeat, or place a literal API key in a command transcript. +3. Always pass `--model MiniMax-H3`; never rely on the configured default model. +4. For a completed video, run one direct blocking `mmx video generate` command. Do not use Bash wrappers or hand-written polling loops. +5. If the terminal command remains active, wait on that exact execution session. Do not run `ps`, scrape process arguments, inspect the output repeatedly, kill the process, or submit another task. +6. Treat `Detecting region... cn` or `Detecting region... global` as normal stderr progress, not a submission failure. +7. Never submit a replacement paid task because terminal waiting, status polling, or downloading was interrupted. +8. Retry the alternate region at most once, and only when the first command clearly failed before task creation because of region detection, endpoint, or authentication routing. +9. Use `--async` only when the user explicitly wants a task ID without waiting or downloading. + +## Resolve The CLI + +Inside the `minimax-cli` repository, build changes and use the local artifact: + +```bash +bun run build +node ./dist/mmx.mjs video generate --help +``` + +Outside the repository, use the installed `mmx` executable. Do not install or update MMX unless the user asks. + +In commands below, replace `mmx` with `node ./dist/mmx.mjs` when testing the local repository build. + +## Resolve And Save The API Key + +Before the first paid H3 request, inspect the active credential without exposing it: + +```bash +mmx auth status --output json --quiet +``` + +- If `method` is `api-key`, reuse it from MMX config. Do not add `--api-key` to generation commands. +- If the user already supplied a key and the runtime holds it securely as `MINIMAX_API_KEY`, save it once, then use MMX config: + +```bash +mmx config set --key api_key --value "$MINIMAX_API_KEY" --quiet +``` + +- Saving `api_key` replaces stale OAuth credentials, clears the cached region, and stores the key in `~/.mmx/config.json` with owner-only permissions. +- Never reconstruct a previously supplied key into visible shell text. Use the runtime's secret/environment injection when available. +- If no saved API key or securely injected variable is available, ask the user to run `mmx auth login` and choose API key. Do not ask them to paste the key into chat again. +- After saving, future Agent commands must omit both the literal key and `--api-key`. + +## Default Completed-Video Path + +Use this path when the user wants the final file: + +```bash +mmx video generate \ + --model MiniMax-H3 \ + --prompt "