# Media Gen

Generate or edit images, videos, or audio in the current task.

- Repository: https://github.com/clacky-ai/openclacky (1209 stars)
- Category: Design
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add clacky-ai/openclacky --skill media-gen -g -a claude-code -y`
Codex: `npx skills add clacky-ai/openclacky --skill media-gen -g -a codex -y`
Cursor: `npx skills add clacky-ai/openclacky --skill media-gen -g -a cursor -y`
Gemini CLI: `npx skills add clacky-ai/openclacky --skill media-gen -g -a gemini-cli -y`

## Description

Generate or edit images, videos, or audio in the current task. Use whenever the user asks to create/generate/produce or edit/modify a picture / image / illustration / cover / poster / icon / artwork, a video / clip / animation, or speech / voiceover / narration / TTS / ambient audio / soundscapes, e.g. generate image, draw, design a cover, edit this image, change the background, text-to-video, generate speech; 画一张, 配图, 编辑图片, 改图, 换背景, 做个视频, 配音, 文字转语音, 环境音. Also use when a document (slides, poster, README hero) needs an inline image.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# media-gen

Generate **and edit** images on demand by calling the local Clacky HTTP server, which dispatches to whichever image-generation model the user configured (`type=image` in their model settings). Editing (image-in → image-out) works with any image model that accepts image input, most current ones do.

## Endpoint

```
POST http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/media/image
GET  http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/media/types
```

## Step 1, Verify a backend is configured

Before generating anything, confirm the user has a `type=image` model set up:

```bash
curl -s http://${CLACKY_SERVER_HOST}:${CLACKY_SERVER_PORT}/api/media/types
```

If the response shows `image.configured = false`, stop and tell the user:

> 还没有配置生图模型。请打开设置页 → 添加模型 → 类型选 `image`（走 openclacky 官方网关时推荐 `or-gemini-3-pro-image` 或 `or-gpt-image-2`）。配好后再让我生图。

Do NOT try to fall back to `terminal` + a hand-written `curl https://api.openai.com/...`, that bypasses the user's configured backend and won't be billed correctly.

**You do NOT configure models, the user does, in the settings page.** Never
edit the user's `config.yml` to add or change a model, and never invent a model
name from memory (e.g. `or-gpt-5.4-image-2` does not exist). The real, current
model is whatever `/api/media/types` reports under `image.model`. If you think a
different model is needed, tell the user which one to set in the settings page, don't touch the config file yourself.

## Step 2, Generate the image

### The model does NOT honor exact pixel sizes

The rest: https://github.com/clacky-ai/openclacky/blob/HEAD/lib/clacky/default_skills/media-gen/SKILL.md
