Skip to content

t1k:model-router:imagine

FieldValue
Modulemodel-router
Version3.47.4
Effortlow
Tools—

Keywords: asset, generate image, gpt-image, icon, illustration, image, image-generation, imagine, picture, sprite

/t1k:model-router:imagine
--prompt "<text>" --out <path> [--model <model>] [--size <WxH>] [--n <count>]

Terminal window
bash .claude/scripts/mr-imagine.sh --prompt "<description>" --out <path>

The script:

  1. Resolves a default --model from providers-config.json’s capabilityPipes["image-generation"] (first ENABLED entry) when none is given.
  2. Validates the model exists, is enabled: true, and declares the image-generation capability — refuses to substitute a different model silently.
  3. Checks the provider against modelRouter.security.allowedProviders, same gate mr-delegate.sh enforces per hop.
  4. POSTs directly to https://ccs.the1studio.org/v1/images/generations (Bearer gh auth token) — not claude -p; there is no text envelope for binary image output to ride.
  5. Decodes the response’s data[0].b64_json and writes it to --out.
  6. 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.

  • 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-multimodal skill (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 duplicate t1k-extended-multimodal’s engine; this skill is a different transport to a different backend.

--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.

Terminal window
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"}

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.

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”).

  • 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.