$npx -y skills add civitai/civitai-gen-skill --skill civitai-genGenerate images, videos, audio, and more using Civitai's orchestration API. Use when the user wants text-to-image, video generation (11+ engines), text-to-speech, music, transcription, bulk batches, experiment sweeps, or buzz cost estimation. Not for browsing or searching Civitai
| 1 | # civitai-gen |
| 2 | |
| 3 | Unified CLI for Civitai's orchestration Workflow API. All generation types share the same workflow lifecycle: submit, poll, download. |
| 4 | |
| 5 | ## Setup |
| 6 | |
| 7 | Requires Node.js 18+. Set `CIVITAI_API_KEY` either as an environment variable or in a `.env` file in this skill's directory (next to `generate.mjs`). Copy `.env.example` to `.env` to start. Get a key at: https://civitai.com/user/account |
| 8 | |
| 9 | > Paths below are relative to this skill's directory. Run the scripts from there (`cd` into it), or prefix with the install path your runtime uses. |
| 10 | |
| 11 | ## Capabilities |
| 12 | |
| 13 | | Command | What it does | Details | |
| 14 | |---------|-------------|---------| |
| 15 | | `wait` | Submit + poll + download (default) | All-in-one blocking generation | |
| 16 | | `submit` | Fire-and-forget, returns workflow ID | For async workflows | |
| 17 | | `status` | Check workflow progress | `--poll` for live updates | |
| 18 | | `download` | Fetch completed media | From a workflow ID | |
| 19 | | `cost` | Dry-run buzz estimation | `whatif=true`, 0 buzz spent | |
| 20 | | `engines` | List video engines + live status | 11+ engines | |
| 21 | | `tts` | Text-to-speech | See `docs/tts.md` | |
| 22 | | `music` | Music/song generation (ACE Step 1.5) | See `docs/music.md` | |
| 23 | | `transcribe` | Speech-to-text transcription | See `docs/transcription.md` | |
| 24 | |
| 25 | ## Quick Examples |
| 26 | |
| 27 | ```bash |
| 28 | # Image (defaults to Flux.1, 4 images) |
| 29 | node generate.mjs wait --prompt "A knight at sunset" -o ./out |
| 30 | |
| 31 | # Multiple concurrent prompts |
| 32 | node generate.mjs wait --prompt "A warrior" --prompt "A mage" -o ./out |
| 33 | |
| 34 | # Video (VEO 3) |
| 35 | node generate.mjs wait --engine veo3 --prompt "A robot walking" -o ./out |
| 36 | |
| 37 | # Text-to-speech |
| 38 | node generate.mjs tts --text "Hello world" --speaker serena -o ./out |
| 39 | |
| 40 | # Music |
| 41 | node generate.mjs music --prompt "upbeat electronic dance track" -o ./out |
| 42 | |
| 43 | # Transcription |
| 44 | node generate.mjs transcribe --media-url "https://example.com/audio.mp3" -o ./out |
| 45 | |
| 46 | # Cost check (any type, 0 buzz) |
| 47 | node generate.mjs cost --prompt "A cat" -n 100 |
| 48 | node generate.mjs cost --engine veo3 --prompt "A robot" --duration 8 |
| 49 | |
| 50 | # Experiment mode (wildcard expansion) |
| 51 | node experiment.mjs --spec experiment.json -o ./out |
| 52 | ``` |
| 53 | |
| 54 | ## Posting What You Generate |
| 55 | |
| 56 | Generate an image (the skill saves it locally), then post the local file in one command: |
| 57 | |
| 58 | ```bash |
| 59 | node generate.mjs wait --prompt "a red apple" -n 1 -o ./out |
| 60 | node mcp-cli.mjs post-image ./out/step_0-0.png --title "My apple" |
| 61 | # -> Post published. URL: https://civitai.com/posts/<id> |
| 62 | ``` |
| 63 | |
| 64 | `post-image` reads the local file, uploads it, and publishes the post — it prints the public URL. Pull `mcp-cli.mjs` first if you don't have it (`curl -fsSL https://mcp.civitai.com/cli -o mcp-cli.mjs`); `CIVITAI_API_KEY` is required. |
| 65 | |
| 66 | Flags: `--title` (defaults to the filename), `--detail`, `--nsfw <level>`, `--draft` (leave unpublished), `--json`. For video/audio, or to attach a pre-uploaded image by UUID, call `create_post` directly (`node mcp-cli.mjs schema create_post`) — and prefer posting the local file over the generate output's `remoteUrls[].url`, which is a short-lived signed URL that expires quickly. |
| 67 | |
| 68 | ## Choosing an Engine & Model |
| 69 | |
| 70 | Read [`docs/engines.md`](docs/engines.md) to pick the right generator. The key split: |
| 71 | |
| 72 | | Path | Engines | How to pick the model | |
| 73 | |------|---------|----------------------| |
| 74 | | **Open-weight ecosystem** | SD1, SDXL, Pony, Illustrious, Flux.1/2, Qwen, Z-Image, Chroma, Anima | Find a **checkpoint AIR** + compatible LoRAs via the **Civitai MCP** (`search_models` / `get_model_version`) → `--model` / `--resources` | |
| 75 | | **Closed API engine** | OpenAI, Google/Gemini, Seedream, Grok, MAI, ERNIE + all video/audio | Engine name only — no checkpoint search, no LoRA | |
| 76 | |
| 77 | **Model discovery uses the Civitai MCP server** (hosted at `https://mcp.civitai.com/mcp`) — call its tools to search checkpoints/LoRAs and get AIR URNs. Don't search inside this skill. A LoRA's base model must match the checkpoint's ecosystem. |
| 78 | |
| 79 | If the Civitai MCP isn't connected, add it (browse tools need no API key): |
| 80 | `claude mcp add --transport http civitai https://mcp.civitai.com/mcp` |
| 81 | |
| 82 | **Can't add MCP config in your runtime?** Pull the zero-dep CLI (Node 18+) and call tools over the shell instead: |
| 83 | `curl -fsSL https://mcp.civitai.com/cli -o mcp-cli.mjs` |
| 84 | `node mcp-cli.mjs call search_models '{"query":"anime portrait","type":"Checkpoint","supportsGeneration":true,"baseModel":"SDXL 1.0"}'` |
| 85 | |
| 86 | ```text |
| 87 | # Call these Civitai MCP tools directly (they return AI |