Agnes Generate Image
Generate or edit images with agnes-image-2.1-flash.
When to use
- The user asks for an image, icon, banner, mockup, product photo, or edited image.
- The user provides a reference image and wants a variation or edit.
Inputs
--prompt: Text description of the desired image.
--size: Output size, e.g. 1024x768, 1024x1024, 768x1024. Default 1024x768.
--image: Optional reference image (local path or URL) for image-to-image.
--response-format: base64 (default) or url. Base64 mode saves images locally.
--n: Number of images. Default 1.
--output-dir: Directory for saved images. Default is ~/AgnesAI/images.
--no-open: Do not open the output folder after saving.
--model: Optional model override. Default is agnes-image-2.1-flash.
Prompt Enhancement (before running the script)
Consult the prompt-components skill to assemble a high-quality prompt:
- Determine interaction mode:
- User gave subject + style + mood → Mode 1 (assemble directly, no questions)
- User gave subject but missing style/mood → Mode 2 (suggest 2–3 combinations)
- User is vague ("draw something") → Mode 3 (ask up to 4 questions)
- Read
prompt-components/references/positive.md for styles, quality boosters, lighting, and composition vocabulary.
- Read
prompt-components/references/negative.md and auto-append relevant negatives (universal + subject-category + style-conflict).
- Translate non-English user input to English for the final prompt.
- Keep positive prompt ≤ 80 words, negative ≤ 30 words.
Steps
- Enhance the prompt using the rules above (do not skip this).
- Run the helper script in this skill directory:
bash scripts/generate_image.sh --prompt "a cat in space" --size 1024x1024
- Return to the user: both the saved file path(s) and the API image URL(s). If the script output contains a URL, always show it. If only a file path is available, state that clearly.
Example
bash scripts/generate_image.sh \
--prompt "A minimalist logo of a rocket, vector style, blue gradient" \
--size 1024x1024 \
--response-format url
Output location
By default (--response-format base64) the generated image is saved to --output-dir and the folder is opened automatically.
- Default:
~/AgnesAI/images on macOS/Linux, or %USERPROFILE%\AgnesAI\images when running under Git Bash on Windows.
- Custom:
bash scripts/generate_image.sh --output-dir ./my_images ...
- Skip opening the folder: add
--no-open.
- URL-only mode:
--response-format url returns a public URL without saving locally.
Templates / references
references/templates.md — prompt templates for creative design, marketing, social media, product shots, style transfer, thumbnails/banners, etc.
API reference
Setup
Set AGNES_API_KEY as an environment variable or in a .env file.
1---2name: agnes-generate-image3description: Generate or edit an image with Agnes AI. Supports text-to-image and image-to-image via agnes-image-2.1-flash.4---56# Agnes Generate Image78Generate or edit images with `agnes-image-2.1-flash`.910## When to use1112- The user asks for an image, icon, banner, mockup, product photo, or edited image.13- The user provides a reference image and wants a variation or edit.1415## Inputs1617- `--prompt`: Text description of the desired image.18- `--size`: Output size, e.g. `1024x768`, `1024x1024`, `768x1024`. Default `1024x768`.19- `--image`: Optional reference image (local path or URL) for image-to-image.20- `--response-format`: `base64` (default) or `url`. Base64 mode saves images locally.21- `--n`: Number of images. Default 1.22- `--output-dir`: Directory for saved images. Default is `~/AgnesAI/images`.23- `--no-open`: Do not open the output folder after saving.24- `--model`: Optional model override. Default is `agnes-image-2.1-flash`.2526## Prompt Enhancement (before running the script)2728Consult the `prompt-components` skill to assemble a high-quality prompt:29301. Determine interaction mode:31 - User gave subject + style + mood → **Mode 1** (assemble directly, no questions)32 - User gave subject but missing style/mood → **Mode 2** (suggest 2–3 combinations)33 - User is vague ("draw something") → **Mode 3** (ask up to 4 questions)342. Read `prompt-components/references/positive.md` for styles, quality boosters, lighting, and composition vocabulary.353. Read `prompt-components/references/negative.md` and auto-append relevant negatives (universal + subject-category + style-conflict).364. Translate non-English user input to English for the final prompt.375. Keep positive prompt ≤ 80 words, negative ≤ 30 words.3839## Steps40411. Enhance the prompt using the rules above (do not skip this).422. Run the helper script in this skill directory:43 ```bash44 bash scripts/generate_image.sh --prompt "a cat in space" --size 1024x102445 ```463. Return to the user: **both** the saved file path(s) **and** the API image URL(s). If the script output contains a URL, always show it. If only a file path is available, state that clearly.4748## Example4950```bash51bash scripts/generate_image.sh \52 --prompt "A minimalist logo of a rocket, vector style, blue gradient" \53 --size 1024x1024 \54 --response-format url55```5657## Output location5859By default (`--response-format base64`) the generated image is saved to `--output-dir` and the folder is opened automatically.6061- Default: `~/AgnesAI/images` on macOS/Linux, or `%USERPROFILE%\AgnesAI\images` when running under Git Bash on Windows.62- Custom: `bash scripts/generate_image.sh --output-dir ./my_images ...`63- Skip opening the folder: add `--no-open`.64- URL-only mode: `--response-format url` returns a public URL without saving locally.6566## Templates / references6768- `references/templates.md` — prompt templates for creative design, marketing, social media, product shots, style transfer, thumbnails/banners, etc.6970## API reference7172- Model: `agnes-image-2.1-flash`73- Docs: https://agnes-ai.com/zh-Hans/docs/agnes-image-21-flash7475## Setup7677Set `AGNES_API_KEY` as an environment variable or in a `.env` file.