Image Generation Skill
Generate or edit images for the current project (website assets, game assets,
UI and product mockups, wireframes, logos, photorealistic images, infographics)
using onyx-cli image. Generation runs server-side with whatever provider the
admin configured at /admin/configuration/image-generation (OpenAI, Gemini, or
Azure) — no API key is needed here.
When a provider isn't configured
If onyx-cli image … exits with "no image generation provider is configured",
stop and tell the user: image generation is unavailable until an admin
configures a provider at /admin/configuration/image-generation. Do not try to
work around it with another tool.
When to use
- Generate a new image (concept art, product shot, hero, texture, sprite).
- Generate a new image guided by reference images (style, composition, mood).
- Edit an existing image (background replacement, object removal, lighting/weather change, compositing, inpainting).
- Produce many assets or variants for one task.
When not to use
- Extending or matching an existing SVG/vector icon set, logo system, or illustration library already in the repo — edit those directly.
- Simple shapes, diagrams, wireframes, or icons better produced as SVG / HTML/CSS / canvas.
- A small project-local asset edit when the source already exists in an editable native format.
- Any task where the user clearly wants deterministic code-native output, not a generated bitmap.
Decision tree
- Intent — new image or edit of an existing image?
- Modify an existing image while preserving parts of it →
image edit.
- Images supplied only as references for style/composition/mood, or no images →
image generate.
- Execution — one asset or many?
- One asset → a single command.
- Many distinct assets → one command per asset (do not use
-n for distinct assets; -n produces variants of one prompt).
Assume the user wants a new image unless they clearly ask to change an existing one.
Usage
Generate (text-to-image)
onyx-cli image generate \
-p "A minimal hero of a ceramic coffee mug, clean product photography, soft studio lighting, wide composition with negative space, no text, no watermark" \
--shape landscape \
-o assets/hero.png
Edit / composite existing image(s)
-i/--input-image may be repeated to composite multiple inputs; the first is the
primary edit source.
onyx-cli image edit \
-i assets/product.png \
-p "Replace only the background with a warm sunset gradient; keep the product and its edges unchanged" \
-o assets/product-sunset.png
Reference images are sent inline, and the sandbox egress proxy rejects any
request body over ~32 MiB with a "request body is larger than the limit"
(body_too_large) error. base64 inflates size by ~33%, so keep each -i image
roughly under ~20 MB on disk (downscale large source images first). This only
affects edit; plain generate has a tiny request body.
Variants of one prompt
onyx-cli image generate -p "Abstract colorful album cover art" -n 3 -o art.png
-n > 1 requires a model that supports multiple images per request (e.g.
gpt-image-*). Some models (e.g. dall-e-3) only support -n 1 and will error
otherwise; if -n > 1 fails, retry with -n 1.
The command prints the saved file path(s), one per line (multiples get a _N
suffix). Open the output with view_image to inspect it and iterate with a
single targeted prompt change.
Flags
| Flag |
Short |
Applies to |
Default |
Description |
--prompt |
-p |
both |
— |
Text prompt / instruction (required). |
--output |
-o |
both |
output.png |
Output path; multiples get _N suffixes. |
--shape |
— |
both |
square |
square, portrait, or landscape. |
--quality |
-q |
both |
provider default |
Render quality (e.g. low/medium/high/auto). |
--num |
-n |
both |
1 |
Variants of a single prompt. |
--input-image |
-i |
edit |
— |
Input image path; repeat to composite. |
Workflow
- Decide intent (
generate vs edit) and execution (single vs repeated commands).
- Collect inputs up front: prompt(s), exact in-image text (verbatim), constraints/avoid list, and any input images with their roles.
- Shape the prompt by specificity: if it's already detailed, normalize it; if generic, add tasteful detail only when it materially improves the result.
- Run
onyx-cli image …, saving project-bound assets into the workspace. Don't overwrite an existing asset unless asked — use a sibling version (e.g. hero-v2.png).
view_image the output; inspect subject, style, composition, and text accuracy; iterate with one targeted change.
- Report the saved path(s) and the final prompt(s).
Prompt schema
Use these labeled lines as scaffolding; include only the ones that help.
Use case: <photorealistic | product-mockup | ui-mockup | infographic | logo | illustration | concept-art | edit:object | edit:background | edit:style | compositing>
Asset type: <where the asset will be used>
Primary request: <main prompt>
Subject: <main subject>
Style/medium: <photo / illustration / 3D / etc.>
Composition/framing: <wide / close / top-down; placement>
Lighting/mood: <lighting + mood>
Color palette: <palette notes>
Text (verbatim): "<exact text>"
Constraints: <must keep / must avoid>
Prompting best practices
- Structure as scene/backdrop → subject → details → constraints.
- State the intended use (ad, UI mock, infographic) to set polish level.
- Use camera/composition language for photorealism.
- Quote exact in-image text verbatim and specify typography + placement; for tricky words, spell them out and require verbatim rendering.
- For edits, repeat the invariants every iteration (
change only X; keep Y unchanged).
- For multi-image inputs, reference each image and describe how to use it.
- Iterate with single-change follow-ups.
- If the prompt is generic, add only detail that materially helps; if it is already detailed, normalize rather than expand.
1---2name: image-generation3description: Generate or edit raster images (photos, illustrations, textures, sprites, mockups, logos, infographics) using the workspace's configured image-generation provider via `onyx-cli image`. Use when the task should produce a brand-new bitmap image, transform an existing image, or derive variants from references — not when the output is better as code-native SVG/vector or built directly in HTML/CSS/canvas. If no image provider is configured, tell the user to set one up at /admin/configuration/image-generation.4---56# Image Generation Skill78Generate or edit images for the current project (website assets, game assets,9UI and product mockups, wireframes, logos, photorealistic images, infographics)10using `onyx-cli image`. Generation runs server-side with whatever provider the11admin configured at `/admin/configuration/image-generation` (OpenAI, Gemini, or12Azure) — **no API key is needed here.**1314## When a provider isn't configured1516If `onyx-cli image …` exits with "no image generation provider is configured",17stop and tell the user: *image generation is unavailable until an admin18configures a provider at `/admin/configuration/image-generation`.* Do not try to19work around it with another tool.2021## When to use22- Generate a new image (concept art, product shot, hero, texture, sprite).23- Generate a new image guided by reference images (style, composition, mood).24- Edit an existing image (background replacement, object removal, lighting/weather change, compositing, inpainting).25- Produce many assets or variants for one task.2627## When not to use28- Extending or matching an existing SVG/vector icon set, logo system, or illustration library already in the repo — edit those directly.29- Simple shapes, diagrams, wireframes, or icons better produced as SVG / HTML/CSS / canvas.30- A small project-local asset edit when the source already exists in an editable native format.31- Any task where the user clearly wants deterministic code-native output, not a generated bitmap.3233## Decision tree34351. **Intent** — new image or edit of an existing image?36 - Modify an existing image while preserving parts of it → `image edit`.37 - Images supplied only as references for style/composition/mood, or no images → `image generate`.382. **Execution** — one asset or many?39 - One asset → a single command.40 - Many *distinct* assets → one command per asset (do **not** use `-n` for distinct assets; `-n` produces variants of one prompt).4142Assume the user wants a new image unless they clearly ask to change an existing one.4344## Usage4546### Generate (text-to-image)4748```bash49onyx-cli image generate \50 -p "A minimal hero of a ceramic coffee mug, clean product photography, soft studio lighting, wide composition with negative space, no text, no watermark" \51 --shape landscape \52 -o assets/hero.png53```5455### Edit / composite existing image(s)5657`-i/--input-image` may be repeated to composite multiple inputs; the first is the58primary edit source.5960```bash61onyx-cli image edit \62 -i assets/product.png \63 -p "Replace only the background with a warm sunset gradient; keep the product and its edges unchanged" \64 -o assets/product-sunset.png65```6667Reference images are sent inline, and the sandbox egress proxy rejects any68request body over ~32 MiB with a "request body is larger than the limit"69(`body_too_large`) error. base64 inflates size by ~33%, so keep each `-i` image70roughly under ~20 MB on disk (downscale large source images first). This only71affects `edit`; plain `generate` has a tiny request body.7273### Variants of one prompt7475```bash76onyx-cli image generate -p "Abstract colorful album cover art" -n 3 -o art.png77```7879`-n > 1` requires a model that supports multiple images per request (e.g.80`gpt-image-*`). Some models (e.g. `dall-e-3`) only support `-n 1` and will error81otherwise; if `-n > 1` fails, retry with `-n 1`.8283The command prints the saved file path(s), one per line (multiples get a `_N`84suffix). **Open the output with `view_image` to inspect it and iterate** with a85single targeted prompt change.8687## Flags8889| Flag | Short | Applies to | Default | Description |90|------|-------|-----------|---------|-------------|91| `--prompt` | `-p` | both | — | Text prompt / instruction (required). |92| `--output` | `-o` | both | `output.png` | Output path; multiples get `_N` suffixes. |93| `--shape` | — | both | `square` | `square`, `portrait`, or `landscape`. |94| `--quality` | `-q` | both | provider default | Render quality (e.g. `low`/`medium`/`high`/`auto`). |95| `--num` | `-n` | both | `1` | Variants of a single prompt. |96| `--input-image` | `-i` | edit | — | Input image path; repeat to composite. |9798## Workflow991. Decide intent (`generate` vs `edit`) and execution (single vs repeated commands).1002. Collect inputs up front: prompt(s), exact in-image text (verbatim), constraints/avoid list, and any input images with their roles.1013. Shape the prompt by specificity: if it's already detailed, normalize it; if generic, add tasteful detail only when it materially improves the result.1024. Run `onyx-cli image …`, saving project-bound assets into the workspace. Don't overwrite an existing asset unless asked — use a sibling version (e.g. `hero-v2.png`).1035. `view_image` the output; inspect subject, style, composition, and text accuracy; iterate with one targeted change.1046. Report the saved path(s) and the final prompt(s).105106## Prompt schema107108Use these labeled lines as scaffolding; include only the ones that help.109110```text111Use case: <photorealistic | product-mockup | ui-mockup | infographic | logo | illustration | concept-art | edit:object | edit:background | edit:style | compositing>112Asset type: <where the asset will be used>113Primary request: <main prompt>114Subject: <main subject>115Style/medium: <photo / illustration / 3D / etc.>116Composition/framing: <wide / close / top-down; placement>117Lighting/mood: <lighting + mood>118Color palette: <palette notes>119Text (verbatim): "<exact text>"120Constraints: <must keep / must avoid>121```122123## Prompting best practices124- Structure as scene/backdrop → subject → details → constraints.125- State the intended use (ad, UI mock, infographic) to set polish level.126- Use camera/composition language for photorealism.127- Quote exact in-image text verbatim and specify typography + placement; for tricky words, spell them out and require verbatim rendering.128- For edits, repeat the invariants every iteration (`change only X; keep Y unchanged`).129- For multi-image inputs, reference each image and describe how to use it.130- Iterate with single-change follow-ups.131- If the prompt is generic, add only detail that materially helps; if it is already detailed, normalize rather than expand.