onimusya/media-gen / skills/media-generation
media-generation
UnverifiedGenerate and edit images, create videos and music, synthesize speech, transcribe and translate audio using multiple AI providers (OpenAI, Google, ElevenLabs, Deepgram, Fal, Luma, Replicate, Stability, Runway, OpenRouter, Edge TTS). Use when the user asks to create media assets, generate pictures, make videos or music, produce voiceovers, transcribe recordings, or work with any visual/audio content.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 1.0 KB |
| RELEASE_NOTES.md | markdown | 8.6 KB |
| SKILL.md | skill md | 9.2 KB |
| scripts/install.cmd | script | 1023 B |
| scripts/install.ps1 | script | 1.7 KB |
| scripts/install.sh | script | 1.1 KB |
| scripts/media-gen.cmd | script | 78 B |
| scripts/media-gen.mjs | script | 564.7 KB |
| scripts/media-gen.ps1 | script | 145 B |
| scripts/media-gen.sh | script | 148 B |
SKILL.md
View on GitHub---
name: media-generation
description: Generate and edit images, create videos and music, synthesize speech, transcribe and translate audio using multiple AI providers (OpenAI, Google, ElevenLabs, Deepgram, Fal, Luma, Replicate, Stability, Runway, OpenRouter, Edge TTS). Use when the user asks to create media assets, generate pictures, make videos or music, produce voiceovers, transcribe recordings, or work with any visual/audio content.
compatibility: Requires Node.js 18+ and at least one provider API key configured in .env (Edge TTS is free, no key needed)
metadata:
author: Francis Hor <francishoe@gmail.com>
version: "1.0"
allowed-tools: Bash(node:*)
---
# Media Generation
Run the CLI at `${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs` with Node.js. Always use `--json` for parseable output.
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs <command> [options] --json
```
## Commands
| Command | Purpose |
|---------|---------|
| `image generate` | Generate images from text prompts |
| `image edit` | Edit existing images with a prompt |
| `video generate` | Generate video from text (async) |
| `video image-to-video` | Animate an image into video |
| `video extend` | Extend an existing video |
| `music generate` | Generate an MP3 from a text prompt |
| `voice tts` | Text to speech synthesis |
| `voice clone` | Clone a voice from audio samples |
| `voice isolate` | Isolate voice from background audio |
| `audio transcribe` | Transcribe audio to text |
| `audio translate` | Translate audio to another language |
| `providers list` | List all providers with capabilities, models, and voices |
| `providers list --configured` | List only configured providers |
| `providers list --capability <cap>` | Filter by capability |
| `providers models` | List all models across all providers |
| `providers models --provider <id>` | List models/voices for a specific provider |
| `providers models --capability <cap>` | Filter models by capability |
| `config init` | Initialize project-level config |
| `config init --global` | Initialize user-level config at ~/.media-gen/ |
| `config validate` | Check which providers are configured |
| `job status` | Check async job status |
| `job download` | Download completed async job result |
## Configuration
Defaults are set via `.env` (at project root or `~/.media-gen/.env` for global). With defaults configured, `--provider`, `--model`, and `--voice-id` are all optional:
```bash
MEDIA_GEN_DEFAULT_PROVIDER=openrouter
MEDIA_GEN_DEFAULT_MODEL=openai/gpt-image-2
MEDIA_GEN_VOICE_PROVIDER=edge-tts
MEDIA_GEN_VOICE_MODEL=
MEDIA_GEN_VOICE_ID=en-US-EmmaMultilingualNeural
MEDIA_GEN_VIDEO_PROVIDER=google
MEDIA_GEN_VIDEO_MODEL=gemini-omni-1.2-flash
MEDIA_GEN_AUDIO_PROVIDER=deepgram
MEDIA_GEN_AUDIO_MODEL=nova-3
MEDIA_GEN_MUSIC_PROVIDER=google
MEDIA_GEN_MUSIC_MODEL=
MEDIA_GEN_LOG_LEVEL=error
```
## Examples
### Image generation
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs image generate \
--prompt "A pixel art fantasy arena" \
--output ./outputs/arena.png \
--json
```
### Video generation (wait for result)
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs video generate \
--provider google \
--model gemini-omni-1.2-flash \
--prompt "A cinematic card pack opening" \
--duration 8 \
--output ./outputs/video.mp4 \
--wait \
--json
```
### Music generation
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs music generate --provider google --prompt "Gentle orchestral piano" --instrumental --output ./outputs/lyria.mp3 --json
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs music generate --provider elevenlabs --prompt "Bright acoustic bossa nova" --duration 15 --instrumental --output ./outputs/eleven.mp3 --json
```
Google defaults to `lyria-3.5` and treats length and instrumental options as prompt guidance.
ElevenLabs defaults to `music_v2_5` and accepts 3 to 600 seconds.
### Text to speech (Edge TTS - free, no API key)
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs voice tts \
--provider edge-tts \
--voice-id en-US-EmmaMultilingualNeural \
--text "Hello world" \
--output ./outputs/voice.mp3 \
--json
```
### Text to speech (ElevenLabs)
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs voice tts \
--provider elevenlabs \
--voice-id JBFqnCBsd6RMkjVDRZzb \
--text "Welcome to the show" \
--output ./outputs/george.mp3 \
--json
```
### Text to speech (Google Gemini TTS)
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs voice tts \
--provider google \
--model gemini-3.1-flash-tts-preview \
--voice-id Kore \
--text "Say cheerfully: Have a wonderful day!" \
--output ./outputs/gemini-voice.wav \
--json
```
### Text to speech (OpenAI)
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs voice tts \
--provider openai \
--model gpt-4o-mini-tts \
--voice-id coral \
--text "Hello from OpenAI" \
--output ./outputs/openai-voice.mp3 \
--json
```
### Text to speech (with defaults set, minimal)
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs voice tts \
--text "Just provide text when defaults are configured" \
--output ./outputs/speech.mp3 \
--json
```
### Transcription
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs audio transcribe \
--input ./audio/recording.mp3 \
--output ./outputs/transcript.json \
--json
```
### List supported providers and models
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs providers list --json
```
### List voices for a TTS provider
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs providers models --provider edge-tts --json
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs providers models --provider elevenlabs --json
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs providers models --provider openai --json
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs providers models --provider google --json
```
### Dry run (validate without calling API)
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs image generate \
--prompt "test" --dry-run --json
```
## Async Video Jobs
OpenRouter, Luma, Runway, fal and Replicate return video job IDs. Google Omni
returns the completed video file synchronously, including without `--wait`.
### Pattern 1: Wait for completion (simple)
Add `--wait` to block until the video is ready:
```bash
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs video generate \
--provider openrouter \
--model google/veo-3.1 \
--prompt "A cinematic scene" \
--output ./outputs/video.mp4 \
--wait \
--poll-interval 5000 \
--timeout 300000 \
--json
```
Returns the final file path when complete.
### Pattern 2: Non-blocking (get job ID, check later)
Without `--wait`, the CLI returns immediately with a job ID:
```bash
# Start generation (returns instantly)
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs video generate \
--provider openrouter \
--model google/veo-3.1 \
--prompt "A cinematic scene" \
--json
# Returns: {"ok": true, "jobId": "YOUR_JOB_ID", "status": "processing"}
# Check status later
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs job status \
--provider openrouter \
--job-id "YOUR_JOB_ID" \
--json
# Returns: {"ok": true, "jobId": "...", "status": "completed"}
# Download the result
node ${CLAUDE_SKILL_DIR}/scripts/media-gen.mjs job download \
--provider openrouter \
--job-id "YOUR_JOB_ID" \
--output ./outputs/video.mp4 \
--json
```
### Async options
| Option | Default | Description |
|--------|---------|-------------|
| `--wait` | false | Block until job completes |
| `--poll-interval` | 5000 | Milliseconds between status checks |
| `--timeout` | 600000 | Max wait time (10 minutes) |
### Async providers
OpenRouter, Luma AI, Runway, Fal.ai, and Replicate use async for video. Google Omni returns the completed video synchronously. Image and TTS are always synchronous.
## Response format
Success:
```json
{"ok": true, "type": "image", "provider": "openai", "model": "gpt-image-2", "outputFile": "./outputs/image.png", "durationMs": 1200}
```
Error:
```json
{"ok": false, "error": {"code": "PROVIDER_NOT_CONFIGURED", "message": "Missing OPENAI_API_KEY", "suggestion": "Set OPENAI_API_KEY in .env"}}
```
## Rules
- Use `--json` for all calls.
- Use `--dry-run` before expensive operations when unsure.
- Never use `--overwrite` unless the user confirms.
- Keep outputs inside the project workspace.
- For video, use `--wait` only when the user wants the file immediately.
- Check the `ok` field in every response before proceeding.
- On error, show the `suggestion` field to the user.
- For TTS, `--voice-id` is optional when `MEDIA_GEN_VOICE_ID` is set in .env.
- Edge TTS is free and requires no API key — prefer it for basic TTS tasks.
## Provider Capabilities
| Provider | Image | Video | TTS | Transcribe | Translate | Clone | Isolate | Music |
|----------|-------|-------|-----|------------|-----------|-------|---------|-------|
| openai | Yes | | Yes | Yes | Yes | | | |
| google | Yes | Yes | Yes | | | | | Yes |
| azure | Yes | | Yes | Yes | Yes | | | |
| elevenlabs | | | Yes | | | Yes | Yes | Yes |
| deepgram | | | Yes | Yes | Yes | | | |
| fal | Yes | Yes | | | | | | |
| luma | | Yes | | | | | | |
| replicate | Yes | Yes | | | | | | |
| stability | Yes | | | | | | | |
| runway | | Yes | | | | | | |
| openrouter | Yes | Yes | | | | | | |
| edge-tts | | | Yes (free) | | | | | |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |