Image studio

From vargasjr-dev/mycadet-temp · View interactive version

Image studio is an AI agent skill from the GitHub repository vargasjr-dev/mycadet-temp. Create images from a text description, or edit photos and graphics the user provides (remove backgrounds or watermarks, retouch, restyle, in-paint). Can produce multiple variants when the user wants options to choose from.

How to use this skill

Skill file

Use the media_generate_image tool via skill_execute to create or edit images.

Modes

Models

Do not pass the model parameter unless you need a specific tier. Omitting it uses the configured default, which is correct for most requests.

When you do need to choose, use an alias, not a concrete model ID. Aliases always resolve to the current model for that tier:

Pass a concrete model ID only if the user names one explicitly. If the tool rejects an unknown model ID, the error lists the currently available models and aliases.

Example calls

Generate (no model parameter, default is correct):

{
  "tool": "media_generate_image",
  "input": {
    "prompt": "A sunset over the ocean, golden hour, soft haze, 35mm photo style",
    "variants": 2
  }
}

Edit:

{
  "tool": "media_generate_image",
  "input": {
    "prompt": "Remove the watermark text from the background. Keep the subject, framing, lighting, and colors exactly identical. Change nothing else.",
    "mode": "edit",
    "source_paths": ["conversations/<conv-id>/attachments/photo.jpeg"],
    "model": "openai"
  }
}

source_paths is a flat array of file path strings. Do NOT pass objects:

Source images for edit mode

Prompting

Timing

Edits on large photos are slow (1 to 2 minutes). If the tool reports a timeout ("timed out after Ns"), the result is lost; do not wait for it to appear. Retry with variants: 1, or if it already was 1, fall back to the CLI which writes files to disk: assistant image-generation generate --prompt "..." --mode edit --source <path> --model openai --output-dir <dir>.

Output handling

Each generated image is saved into the workspace under media/generated/ and the tool result lists the saved paths. The images also come back as inline content blocks so you can judge the result before presenting it.

Error handling

Two kinds of failure. Treat them differently:

  1. Configuration errors (missing API key, provider not set up): report the error to the user as-is. Do NOT change service configuration (managed vs your-own mode, default provider, or default model in Settings). Configuration changes happen only at the user's explicit request.
  2. Generation failures (any other error: "invalid", content policy, safety rejection, provider error). Do not diagnose the cause; switch providers. The error message names the model that failed:

Do NOT rephrase the prompt and retry on the same model, even if the error suggests checking the prompt. One provider switch, then stop.

Complete when

The tool has returned at least one image and your reply presents it to the user, preferably as an inline ![description](cadet://workspace/...) embed of the saved path. An error report counts as complete only after the retry path in Error handling has been exhausted.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.