$npx -y skills add Negai-ai/AgentClaw --skill image-generationGenerate, edit, and iterate raster images from text prompts or reference images with GPT Image, Nano Banana, or Seedream. Use for visual asset creation, concept art, product/mockup imagery, style exploration, thumbnails, illustrations, and image transformation workflows across im
| 1 | # Image Generation Skill |
| 2 | |
| 3 | Use this skill for image creation and image editing work that should call an image provider API and save usable raster files. |
| 4 | |
| 5 | ## Provider Selection |
| 6 | |
| 7 | Current complete provider: |
| 8 | |
| 9 | - OpenAI GPT Image Image API: read `references/openai.md`; use `scripts/openai_generate_image.py` for repeatable command-line generation and editing. This runner also accepts an OpenAI-compatible `base_url` for GPT Image compatible providers. |
| 10 | - Nano Banana image generation: read `references/nano_banana.md`; use `scripts/nano_banana_generate_image.py` for Nano Banana 2, Nano Banana Pro, and Nano Banana generation/editing. |
| 11 | - Seedream image generation on Volcengine Ark: read `references/seedream.md`; use `scripts/seedream_generate_image.py` for Seedream 5 text-to-image, image-to-image, coherent image groups, streaming, and web search. |
| 12 | |
| 13 | Reserved provider integration: |
| 14 | |
| 15 | - Future providers should add one `references/<provider>.md` file and one `scripts/<provider>_generate_image.py` runner following `references/provider_contract.md`. |
| 16 | |
| 17 | ## Workflow |
| 18 | |
| 19 | 1. Capture the visual brief: subject, style, composition, aspect ratio, output count, quality, format, destination folder, and any reference images. |
| 20 | 2. Pick the provider. OpenAI is the supported default in this skill. |
| 21 | 3. Check the provider API key before calling the script. If the key is missing, tell the user the exact variable to configure; after the user provides or confirms the key, write/update it in the project `.env` and update the current temporary environment before retrying. |
| 22 | 4. Read the matching provider reference when API parameters, edits, masks, streaming, or model limits matter. |
| 23 | 5. Use the provider script for deterministic file output when possible; otherwise write a small one-off call using the same output contract. |
| 24 | 6. Save generated files to the requested path, or to `generated_images` when no path is specified. |
| 25 | 7. Return the saved file paths, `output_dir`, provider/model, size/quality/format, revised prompt when available, and any provider response ID. For user-visible Markdown images, use browser-safe URLs only; if the script returns local `output_paths`, call `create_download_url` for each image and use the returned URL instead of embedding local paths. |
| 26 | |
| 27 | ## API Key Handling |
| 28 | |
| 29 | Required keys by provider: |
| 30 | |
| 31 | - OpenAI official or compatible GPT Image: `OPENAI_IMAGE_KEY`. Compatible services may also need the optional endpoint override `OPENAI_BASE_URL` or `--base-url`. |
| 32 | - Nano Banana: `GOOGLE_IMAGE_KEY`. |
| 33 | - Seedream on Volcengine Ark: `ARK_API_KEY`. |
| 34 | |
| 35 | The bundled runners automatically load `.env` before reading these variables. They check `AGENTCLAW_PROJECT_DIR/.env`, the current working directory `.env`, and the AgentClaw project `.env`, then copy loaded values into the script process environment without overriding already exported variables. |
| 36 | |
| 37 | When a selected provider key is not configured, tell the user which key is needed and wait for the user to provide or configure it. After the user provides the value, update the project `.env` and the current temporary environment for this session before rerunning the provider script. Keep secrets out of prompts, logs, references, tests, and generated reports. |
| 38 | |
| 39 | All bundled runners default to `generated_images` and include `output_dir` plus `absolute_output_dir` in their JSON result. These are local filesystem directories, not browser URLs. |
| 40 | |
| 41 | ## OpenAI Quick Start |
| 42 | |
| 43 | ```bash |
| 44 | python agentclaw/skills/builtin_skills/image-generation/scripts/openai_generate_image.py \ |
| 45 | --prompt "A clean product hero image of a compact desktop AI assistant device" \ |
| 46 | --output-dir generated_images \ |
| 47 | --model gpt-image-2 |
| 48 | ``` |
| 49 | |
| 50 | For explicit GPT Image output parameters: |
| 51 | |
| 52 | ```bash |
| 53 | python agentclaw/skills/builtin_skills/image-generation/scripts/openai_generate_image.py \ |
| 54 | --prompt "A polished app icon for AgentClaw, sharp claw mark plus workflow nodes" \ |
| 55 | --model gpt-image-2 \ |
| 56 | --size 1024x1024 \ |
| 57 | --quality high \ |
| 58 | --format png |
| 59 | ``` |
| 60 | |
| 61 | For an OpenAI-compatible image service: |
| 62 | |
| 63 | ```bash |
| 64 | python agentclaw/skills/builtin_skills/image-generation/scripts/openai_generate_image.py \ |
| 65 | --prompt "A square face icon in a clean 3D style" \ |
| 66 | --base-url https://api.squarefaceicon.org/v1 \ |
| 67 | --model gpt-image-2 \ |
| 68 | --size 1024x1024 |
| 69 | ``` |
| 70 | |
| 71 | For an edit or reference-image composition: |
| 72 | |
| 73 | ```bash |
| 74 | python agentclaw/skills/builtin_skills/image-generation/scripts/openai_generate_image.py \ |
| 75 | --prompt "Create a cohesive product bundle image using these reference items" \ |
| 76 | --input-image body-lotion.png \ |
| 77 | --input-image soap.png \ |
| 78 | --output-dir generated_images |
| 79 | ``` |
| 80 | |
| 81 | For a masked edit: |
| 82 | |
| 83 | ```bash |
| 84 | python agentclaw/skills/builtin_skills/image-gen |