t1k:model-router:imagine
| Field | Value |
|---|---|
| Module | model-router |
| Version | 3.47.4 |
| Effort | low |
| Tools | — |
Keywords: asset, generate image, gpt-image, icon, illustration, image, image-generation, imagine, picture, sprite
How to invoke
Section titled “How to invoke”/t1k:model-router:imagine--prompt "<text>" --out <path> [--model <model>] [--size <WxH>] [--n <count>]How It Works
Section titled “How It Works”bash .claude/scripts/mr-imagine.sh --prompt "<description>" --out <path>The script:
- Resolves a default
--modelfromproviders-config.json’scapabilityPipes["image-generation"](first ENABLED entry) when none is given. - Validates the model exists, is
enabled: true, and declares theimage-generationcapability — refuses to substitute a different model silently. - Checks the provider against
modelRouter.security.allowedProviders, same gatemr-delegate.shenforces per hop. - POSTs directly to
https://ccs.the1studio.org/v1/images/generations(Bearergh auth token) — notclaude -p; there is no text envelope for binary image output to ride. - Decodes the response’s
data[0].b64_jsonand writes it to--out. - Fails loudly on any missing/empty result — never writes a 0-byte or placeholder file.
Deliberately NOT auto-intercepted through the Task pipeline. Unlike text delegation (which the mr-task-interceptor.cjs hook routes transparently), image generation is always an explicit call — a delegated text agent must never silently produce a surprise binary write. Invoke this skill, or call mr-imagine.sh directly, when the user actually wants an image.
When to Use
Section titled “When to Use”- The user asks for an icon, sprite, illustration, placeholder art, or any other generated image asset.
- A game-dev or design workflow needs a quick AI-generated visual and the studio’s
t1k-extended-multimodalskill (Gemini/Imagen “Nano Banana”) isn’t the target — this is the routed transport through model-router’s own infrastructure and cost tracking, not a vendor SDK call. Don’t duplicatet1k-extended-multimodal’s engine; this skill is a different transport to a different backend.
Write-target safety (P3)
Section titled “Write-target safety (P3)”--out MUST resolve under one of:
/tmp/...<cwd>/assets/...<cwd>/generated/...
A path outside these (including anything a ../ traversal collapses to) is refused before any network call is made. Create the target subdirectory intent explicitly in your prompt if it doesn’t fall under one of these three roots — the script does not silently redirect the write elsewhere.
Example
Section titled “Example”bash .claude/scripts/mr-imagine.sh \ --prompt "a minimalist app icon, flat design, blue gradient background, white gear symbol" \ --out ./assets/gear-icon.png \ --size 1024x1024{"status":"ok","path":"/abs/path/assets/gear-icon.png","bytes":1064560,"model":"gpt-image-1.5","provider":"kimi"}Model Reference
Section titled “Model Reference”Read .claude/providers-config.json → capabilityPipes["image-generation"] for the current ordered default preference, and each model’s own providers.<name>.models.<model> entry for its enabled state — the shipped default and enable flags drift over time and are the single source of truth, not this doc.
Errors
Section titled “Errors”Every failure exits non-zero with a specific message on stderr — a disabled/missing/non-image-gen model, a disallowed provider, a missing gh auth login, a non-200 HTTP response, an empty b64_json, or a --out outside the write-target allowlist. None of these degrade into a placeholder file or a silently-wrong model swap (rules/development-principles.md § “Errors Over Silent Fallbacks”).
Related
Section titled “Related”The1Studio/theonekit-model-router#92— the full P0-P7 design history and the CLIProxy backend confirmation.t1k-model-router-delegate— the sibling skill for TEXT delegation; a different transport, same kit.t1k-extended-multimodal(core) — the Gemini/Imagen image-generation ENGINE; this skill is the routed TRANSPORT to a different backend, not a duplicate.