generate-image

A command that creates an image from a written description using one of several Flux-based image models.

In plain words
What is it for?
Use it to make images from text prompts, choosing a model and square output size. It requires a DEAPI API key.
Why use it?
It removes the need to create images manually or connect to an image-generation service yourself.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/deapi-ai/claude-code-skills/generate-image
Clone the repo
git clone --depth 1 https://github.com/deapi-ai/claude-code-skills
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 785 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00785
Opus 5 $0.00010 $0.00392
Sonnet 5 $0.00004 $0.00157
Haiku 4.5 $0.00002 $0.00078

Measured 2d ago against content hash 299e53ef9feb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

generate-image scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -X POST "https://api.deapi.ai/api/v1/client/txt2img" \
deapi/commands/generate-image.md · 87 lines

How it starts

The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Image Generation via deAPI

Generate image from prompt: $ARGUMENTS

Step 1: Parse arguments

Extract from $ARGUMENTS:

  • prompt: The text description (required)
  • --model: klein (default, recommended), flux (higher max resolution), or turbo (fastest)
  • --size: 512, 768, or 1024 (default: 1024). Klein supports up to 1536.

Step 2: Send request

curl -s -X POST "https://api.deapi.ai/api/v1/client/txt2img" \
  -H "Authorization: Bearer $DEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "{prompt}",
    "model": "{model_name}",
    "width": {size},
    "height": {size},
    "steps": {steps},
    "seed": {random_seed}
  }'

Model mapping:

User flag API model name Steps Max size Info
klein (default) Flux_2_Klein_4B_BF16 4 (fixed) 1536 Recommended, txt2img + img2img, multi-image
flux Flux1schnell 4-10 (default: 4) 2048 Higher max resolution
turbo ZImageTurbo_INT8 4-10 (default: 4) 1024 Fastest

Klein model limits:

  • Resolution: 256-1536px (step: 16)
  • Steps: 4 (fixed)
  • Guidance: not supported (parameter ignored)

Important: Generate a random seed (0-999999) for each request.

Note: Klein does not support guidance parameter - omit it or it will be ignored.

Step 3: Poll status (feedback loop)

Extract request_id from response, then poll every 10 seconds:

curl -s "https://api.deapi.ai/api/v1/client/request-status/{request_id}" \
  -H "Authorization: Bearer $DEAPI_API_KEY"

Status handling:

  • processing → wait 10s, poll again
  • done → proceed to Step 4
  • failed → report error message to user, STOP

Step 4: Fetch and present result

When status = "done":

  1. Get image URL from result_url
  2. Display/download the generated image
  3. Show the image to the user

Step 5: Offer follow-up

Ask user:

  • "Would you like variations with a modified prompt?"
  • "Should I upscale this image?"
  • "Would you like to transform this with additional images?" (Klein supports up to 3 input images in img2img)

Read the full file on GitHub · 87 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 87 lines · 20 tokens per session scan A 299e53ef9feb

Subscribe to this mod's changes

generate-image is a command published in the GitHub repository deapi-ai/claude-code-skills (21 stars, last pushed 2mo ago), licensed MIT. It adds 20 tokens to every session and 785 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.