image-gen — anti-slop image gen

Caution

Raw prompts produce AI-looking images. Symmetrical faces, plastic skin, impossible reflections, airbrushed gradients — the usual tells. The skill applies a style-matched anti-slop prefix automatically so you don’t have to fight defaults every time.

Tip

Fast path: just type a prompt. No flags needed — the skill picks Gemini Imagen 4, photo style, 1024×1024, and goes. Only asks questions when something is genuinely missing (API key, or you passed --count/--style flags explicitly).

Quick reference

FieldValue
Command/brewui:image-gen
Arguments[prompt] [--edit image.png 'instructions'] [--config] [--update] [--service] [--style] [--count N] [--output dir] [--size WxH]
Modelhaiku
ToolsRead, Write, Edit, Bash, Glob, Grep, AskUserQuestion, WebSearch
OutputPNG files + sidecar JSON metadata in .claude/reports/images/

When to use

  • Quick OG image"minimalist tech blog header, dark mode, purple accents" and done
  • Batch variations--count 4 to compare options before committing to one
  • Edit an existing image--edit hero.png "remove background, add soft shadow" (Gemini + OpenAI only)
  • Cost-conscious iteration — use OpenRouter Gemini 2.5 Flash (~$0.001) for drafts, switch to GLM-image or Imagen 4 for finals
  • API key setup--config walks through key entry, validation, and storage once

Examples

# Default: Gemini Imagen 4, photo style, 1024×1024
/brewui:image-gen "developer at a standing desk, morning light through large windows"
# Illustration style, custom provider
/brewui:image-gen --style illustration --service zai "tech blog header, geometric shapes, dark background"
# Edit an existing image (Gemini or OpenAI only)
/brewui:image-gen --edit ./hero.png "remove the background, increase contrast"

Providers

ProviderModelSpeedQualityCost
gemini (default)Imagen 4FastVery HighPaid plan required
openrouterGemini 2.5 Flash ImageFastHigh~$0.001/image
openrouter-gpt5GPT-5 ImageMediumHighest~$0.01/image
zaiGLM-imageFastVery High~$0.015/image
openaiDALL-E 3MediumHigh$0.04–0.12/image

Edit support: gemini (native), openai (DALL-E 2 fallback). OpenRouter redirects to a supported provider.

Flow

  1. Parse arguments

    Runs parse-args.sh to extract flags. Detects mode from explicit flags first, then natural language signals (“edit this”, “configure key”), then defaults to generate.

  2. Resolve API key

    Checks in order: inline in prompt text → .env → shell environment variable → interactive config (Phase C). Stops here if no key is found and guides setup.

  3. Fast-path or gather params

    Prompt provided, no extra flags? Skip count/service/style/output questions — use defaults straight away. Explicit flags or missing prompt triggers targeted questions only.

  4. Build enhanced prompt

    Loads the anti-slop prefix for the chosen style from references/anti-slop.md, prepends it to your prompt, then constructs the provider JSON payload.

  5. Send request & save

    Calls the provider API, parses base64 or URL response, saves each image as kebab-title-NNN.png with a sidecar .json (prompt, service, style, size, timestamp, cost estimate).

  6. Report & offer next action

    Prints a results table with file paths, provider, cost estimate. Asks: generate more, different prompt, edit one, or done.

Full provider matrix, anti-slop rules, and parameter reference

Anti-slop prefixes by style

StyleEnforcesBans
photoReal lighting physics, correct anatomy, natural material textures, depth of fieldPlastic skin, impossible reflections, symmetrical faces
illustrationClean line work, proper color theory, organic imperfections, consistent styleAirbrushed gradients, floating elements, generic clip-art feel
artUnified brushwork, intentional composition, coherent color temperature, visible techniqueMixed-media confusion, over-processed look

All parameters

ParameterDefaultOptionsDescription
--servicegeminigemini, openrouter, openrouter-gpt5, zai, openaiProvider
--stylephotophoto, illustration, artAnti-slop preset
--count11–10Images per generation (DALL-E 3: sequential requests)
--size1024x1024WxHImage dimensions
--output.claude/reports/images/Directory pathSave location
--edit<image.png> 'instructions'Edit mode
--configAPI key setup
--updateCheck providers for latest models/pricing

API key priority

  1. Explicit key pasted in prompt text
  2. .env in project root (source .env)
  3. Shell environment variable
  4. Interactive config (Phase C)

For team projects use .env (add to .gitignore). For personal use &#126;/.zshrc works well.

Update mode

Runs WebSearch for each provider’s latest models and pricing, compares against references/providers.md, and offers to update the file if changes are detected.

🖼️

GLM Design to Code

Turn images, HTML, or URLs into multi-framework code using GLM vision.

🔗

GitHub source

Source code, anti-slop references, and provider specs.

📄

Brewui overview

All brewui skills in one place.

Updating plugins

Use /brewtools:plugin-update to check and update the brewcode plugin suite in one command. See the FAQ for details.