Media-Gen Core
Shared model for the media-gen cluster. The generators and processors all hang off one
decision and one pipeline — keep them consistent here so no spoke contradicts another.
1. The routing decision (this cluster's defining choice)
Every generative request resolves on two axes: modality (what asset) × access model (what
it costs / what it needs to run). Pick the cell, then the spoke.
Request ──> [ modality: image | 3D | video | GIF ]
──> [ access: subscription-CLI | API-key+billing | local/hosted-GPU | free-search ]
──> spoke
- Subscription-CLI — runs through an existing consumer plan, no per-asset billing.
gpt-image-2 (your ChatGPT Plus/Pro via the Codex CLI). Cheapest marginal cost; rate-limited by
the plan.
- API-key + billing — a provider key, billed per image/call.
openai-image-gen (OpenAI Images
API, OPENAI_API_KEY), and paid image/video APIs in general. Predictable, scalable, costs money
per call — state batch size before running.
- Local / hosted-GPU — model runs on a GPU you reach, not a metered text-prompt API.
hunyuan3d (Tencent Hunyuan3D-2.1 via a Hugging Face Gradio endpoint). No per-call billing, but
subject to the endpoint's availability/queue.
- CLI-inference / grounded —
nano-banana-2 (Gemini 3.1 Flash Image via the infsh CLI;
multi-image input up to 14, Google-Search grounding) sits between subscription and API depending
on how it's keyed.
- Free-search / processing — no generation at all:
gifgrep (search & download), ffmpeg /
video-frames (deterministic local transforms), image-enhancer (upscale). Zero model cost.
Rule: confirm the chosen backend's prerequisite (plan / key / GPU endpoint) is present
before generating; never silently swap one access model for another — a failed or mis-billed
call is the failure mode this cluster exists to prevent.
2. The pipeline (how spokes compose)
GENERATE ──> TRANSFORM ──> ASSEMBLE/DELIVER
image/3D/video enhance · restyle · extract encode · size-fit · gallery
Generators emit raw assets; processors refine and package them. A request that needs motion or a
final container almost always ends in ffmpeg. Examples:
- Still → upscaled still:
gpt-image-2/nano-banana-2/openai-image-gen → image-enhancer.
- Photo → 3D: reference image (any image spoke) →
hunyuan3d → GLB.
- Concept → clip:
ai-video-director (shots) → ffmpeg (encode/resize) ; pull stills with
video-frames.
- Reaction GIF:
gifgrep (find/extract) or slack-gif-creator (author) → ffmpeg (GIF↔MP4,
size fit).
3. Backend / modality matrix
| Modality |
Spoke |
Backend |
Access model |
Output |
| Image (gen) |
gpt-image-2 |
GPT Image 2 (ChatGPT Images 2.0) |
subscription-CLI (ChatGPT Plus/Pro) |
PNG, edits, refs |
| Image (gen) |
nano-banana-2 |
Gemini 3.1 Flash Image |
infsh CLI (multi-image, grounded) |
images, multi-input edits |
| Image (gen, batch) |
openai-image-gen |
OpenAI Images API |
API key + billing |
PNG + index.html gallery |
| Image (system) |
art |
mixed (icons, diagrams, mermaid) |
provider keys in agent .env |
headers, icons, diagrams |
| Image (transform) |
image-enhancer |
upscaler |
local / no model cost |
sharpened/upscaled image |
| 3D |
hunyuan3d |
Hunyuan3D-2.1 |
hosted GPU (HF Gradio) |
GLB / OBJ / PLY / STL |
| Video (gen) |
ai-video-director |
Kling 3.0 · Sora · Grok |
per-tool (key/plan) |
shot-by-shot prompts → clips |
| Video (process) |
ffmpeg |
FFmpeg |
local CLI |
convert/resize/compress/audio |
| Video (extract) |
video-frames |
FFmpeg |
local CLI |
frames / short clips |
| GIF (find) |
gifgrep |
GIF providers |
free search/download |
GIFs, stills, sheets |
| GIF (author) |
slack-gif-creator |
composable primitives |
local |
Slack-size-validated GIF |
4. Output & convention notes
- Formats: 3D → GLB is the portable default (OBJ/PLY/STL on request). Video masters stay in a
lossless/high-bitrate container; only down-encode at the delivery step. GIF for Slack must pass
the size validators in
slack-gif-creator.
- Determinism:
ffmpeg, video-frames, image-enhancer, gifgrep are reproducible; the
generative spokes are not — same prompt ≠ same output. Capture the prompt/seed when one matters.
- Reference images (image-to-image / multi-ref / image-to-3D) are first-class inputs across
gpt-image-2, nano-banana-2, and hunyuan3d — feed an asset from an earlier stage rather than
re-describing it.
5. Shared guardrails
- Prerequisite before spend: verify plan/key/GPU endpoint exists before a generative call.
- State the cost/quota of any batch or paid API run up front.
- Don't swap access models silently — subscription, API-billing, and local are not equivalent.
- Respect provider content policy and the license/attribution of downloaded GIFs and
reference images.
- Preserve masters: re-encode lossless-aware; never transcode the source in place.
- Generative output is non-deterministic — record prompt/seed when reproducibility matters.
1---2name: media-gen-core3description: Shared reference for the media-gen cluster: the backend-routing decision (access/billing model × modality), the generate→transform→assemble pipeline, output-format conventions, and the cross-tool guardrails. USE WHEN choosing an image/video/3D/GIF backend, planning a multi-stage media pipeline, or reasoning about cost, format, or provider policy.4---56# Media-Gen Core78Shared model for the `media-gen` cluster. The generators and processors all hang off one9decision and one pipeline — keep them consistent here so no spoke contradicts another.1011## 1. The routing decision (this cluster's defining choice)1213Every generative request resolves on two axes: **modality** (what asset) × **access model** (what14it costs / what it needs to run). Pick the cell, then the spoke.1516```17Request ──> [ modality: image | 3D | video | GIF ]18 ──> [ access: subscription-CLI | API-key+billing | local/hosted-GPU | free-search ]19 ──> spoke20```2122- **Subscription-CLI** — runs through an existing consumer plan, *no* per-asset billing.23 `gpt-image-2` (your ChatGPT Plus/Pro via the Codex CLI). Cheapest marginal cost; rate-limited by24 the plan.25- **API-key + billing** — a provider key, billed per image/call. `openai-image-gen` (OpenAI Images26 API, `OPENAI_API_KEY`), and paid image/video APIs in general. Predictable, scalable, **costs money27 per call** — state batch size before running.28- **Local / hosted-GPU** — model runs on a GPU you reach, not a metered text-prompt API.29 `hunyuan3d` (Tencent Hunyuan3D-2.1 via a Hugging Face Gradio endpoint). No per-call billing, but30 subject to the endpoint's availability/queue.31- **CLI-inference / grounded** — `nano-banana-2` (Gemini 3.1 Flash Image via the `infsh` CLI;32 multi-image input up to 14, Google-Search grounding) sits between subscription and API depending33 on how it's keyed.34- **Free-search / processing** — no generation at all: `gifgrep` (search & download), `ffmpeg` /35 `video-frames` (deterministic local transforms), `image-enhancer` (upscale). Zero model cost.3637**Rule:** confirm the chosen backend's prerequisite (plan / key / GPU endpoint) is present38**before** generating; never silently swap one access model for another — a failed or mis-billed39call is the failure mode this cluster exists to prevent.4041## 2. The pipeline (how spokes compose)4243```44GENERATE ──> TRANSFORM ──> ASSEMBLE/DELIVER45 image/3D/video enhance · restyle · extract encode · size-fit · gallery46```4748Generators emit raw assets; processors refine and package them. A request that needs motion or a49final container almost always ends in `ffmpeg`. Examples:50- Still → upscaled still: `gpt-image-2`/`nano-banana-2`/`openai-image-gen` → `image-enhancer`.51- Photo → 3D: reference image (any image spoke) → `hunyuan3d` → GLB.52- Concept → clip: `ai-video-director` (shots) → `ffmpeg` (encode/resize) ; pull stills with53 `video-frames`.54- Reaction GIF: `gifgrep` (find/extract) **or** `slack-gif-creator` (author) → `ffmpeg` (GIF↔MP4,55 size fit).5657## 3. Backend / modality matrix5859| Modality | Spoke | Backend | Access model | Output |60|---|---|---|---|---|61| Image (gen) | `gpt-image-2` | GPT Image 2 (ChatGPT Images 2.0) | subscription-CLI (ChatGPT Plus/Pro) | PNG, edits, refs |62| Image (gen) | `nano-banana-2` | Gemini 3.1 Flash Image | `infsh` CLI (multi-image, grounded) | images, multi-input edits |63| Image (gen, batch) | `openai-image-gen` | OpenAI Images API | API key + billing | PNG + `index.html` gallery |64| Image (system) | `art` | mixed (icons, diagrams, mermaid) | provider keys in agent `.env` | headers, icons, diagrams |65| Image (transform) | `image-enhancer` | upscaler | local / no model cost | sharpened/upscaled image |66| 3D | `hunyuan3d` | Hunyuan3D-2.1 | hosted GPU (HF Gradio) | GLB / OBJ / PLY / STL |67| Video (gen) | `ai-video-director` | Kling 3.0 · Sora · Grok | per-tool (key/plan) | shot-by-shot prompts → clips |68| Video (process) | `ffmpeg` | FFmpeg | local CLI | convert/resize/compress/audio |69| Video (extract) | `video-frames` | FFmpeg | local CLI | frames / short clips |70| GIF (find) | `gifgrep` | GIF providers | free search/download | GIFs, stills, sheets |71| GIF (author) | `slack-gif-creator` | composable primitives | local | Slack-size-validated GIF |7273## 4. Output & convention notes7475- **Formats**: 3D → GLB is the portable default (OBJ/PLY/STL on request). Video masters stay in a76 lossless/high-bitrate container; only down-encode at the delivery step. GIF for Slack must pass77 the size validators in `slack-gif-creator`.78- **Determinism**: `ffmpeg`, `video-frames`, `image-enhancer`, `gifgrep` are reproducible; the79 generative spokes are **not** — same prompt ≠ same output. Capture the prompt/seed when one matters.80- **Reference images** (image-to-image / multi-ref / image-to-3D) are first-class inputs across81 `gpt-image-2`, `nano-banana-2`, and `hunyuan3d` — feed an asset from an earlier stage rather than82 re-describing it.8384## 5. Shared guardrails8586- **Prerequisite before spend**: verify plan/key/GPU endpoint exists before a generative call.87- **State the cost/quota** of any batch or paid API run up front.88- **Don't swap access models silently** — subscription, API-billing, and local are not equivalent.89- **Respect provider content policy** and the **license/attribution** of downloaded GIFs and90 reference images.91- **Preserve masters**: re-encode lossless-aware; never transcode the source in place.92- Generative output is non-deterministic — record prompt/seed when reproducibility matters.