
invokeai-image-gen
Generate images using InvokeAI's local API. Use when asked to generate, create, or make images with InvokeAI, FLUX.2 Klein, Z-Image Turbo, FLUX, or SDXL models. Supports text-to-image generation, automatic model detection, image download, and parameter selection based on model architecture.
- Installs
- 63
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/sammcj/agentic-coding --skill invokeai-image-gen- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads invokeai-image-gen automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
InvokeAI Image Generation
Generate images via InvokeAI's REST API. Supports FLUX.2 Klein (default), Z-Image Turbo, FLUX.1, and SDXL.
Quick Start
Simply call the script with your prompt and the output file name:
python scripts/generate.py -p "A dramatic sunset over snow-capped mountains, warm orange light reflecting off a still alpine lake in the foreground. Soft clouds catch the fading light." -o sunset.png
Overriding The Default Model
If the user asks you to use a specific model, first find the model key, then use it in the command:
python scripts/generate.py --list-models | grep -i 'flux'
python scripts/generate.py -p "A tabby cat with bright green eyes sits on a weathered wooden windowsill, soft afternoon light streaming through lace curtains. Cosy, intimate mood." --model MODEL_KEY -o cat.png
Options
| Option | Description |
|---|---|
--prompt, -p | Generation prompt (required) |
--negative, -n | Negative prompt (SDXL only) |
--model, -m | Model key (UUID) or partial name match |
--width, -W / --height, -H | Dimensions |
--steps, -s | Denoising steps |
--cfg, -c | CFG scale |
--guidance, -g | Guidance strength (FLUX.1 only) |
--scheduler | Sampling scheduler |
--seed | Random seed |
--output, -o | Output path (default: invokeai-{seed}.png) |
--list-models | List installed models |
--json | JSON output |
Model Defaults
Note: FLUX.2 Klein is the latest model which is used by default.
| Model | Steps | Guidance | CFG | Scheduler |
|---|---|---|---|---|
| FLUX.2 Klein | 4 | 3.5 | 1.0 | euler |
| Z-Image Turbo | 9 | - | 1.0 | euler |
| FLUX.1 dev | 28 | 3.5 | 1.0 | euler |
| FLUX.1 Krea dev | 28 | 4.5 | 1.0 | euler |
| FLUX.1 Kontext dev | 28 | 2.5 | 1.0 | euler |
| FLUX.1 schnell | 4 | 0.0 | 1.0 | euler |
| SDXL | 25 | - | 6.0 | dpmpp_2m_k |
| SDXL Turbo | 8 | - | 1.0 | dpmpp_sde |
All models default to 1024x1024. FLUX requires dimensions divisible by 16, SDXL by 8.
FLUX.1 Variant Notes
- FLUX.1 dev: Standard text-to-image model, balanced quality/speed
- FLUX.1 Krea dev: Fine-tuned for aesthetic photography, use higher guidance (4.5)
- FLUX.1 Kontext dev: Image editing model, use lower guidance (2.5)
- FLUX.1 schnell: Distilled fast model, 4 steps, no guidance needed
Model Selection
Auto-priority: Klein > Z-Image > FLUX > SDXL
Detection by name/base:
- flux2_klein: "klein" in name or "flux2" in base
- flux_krea: "krea" in name (FLUX.1 base)
- flux_kontext: "kontext" in name (FLUX.1 base)
- flux_schnell: "schnell" in name (FLUX.1 base)
- flux: "flux" in base (standard dev)
- zimage: "z-image" in base or "z-image/zimage" in name
- sdxl: "sdxl" in base (turbo/lightning variants auto-detect)
Prompting (general information, but especially useful for FLUX.2 Klein)
Write prose, not keywords. Structure: Subject -> Setting -> Details -> Lighting -> Atmosphere
A weathered fisherman in his late sixties stands at the bow of a wooden boat,
wearing a salt-stained wool sweater. Golden hour sunlight filters through
morning mist, creating quiet determination and solitude.
Key techniques:
- Front-load critical elements (word order matters)
- Specify lighting: source, quality, direction, temperature
- Include sensory texture: materials, reflections, atmosphere
Good: "A woman with short blonde hair poses against a light neutral background wearing colourful earrings, resting her chin on her hand."
Bad: "woman, blonde, short hair, neutral background, earrings"
Append style tags: Style: Country chic. Mood: Serene, romantic.
Troubleshooting
| Issue | Solution |
|---|---|
| Connection refused | Check InvokeAI is running |
| Model not found | Use --list-models for valid keys |
| Dimensions error | FLUX: multiples of 16, SDXL: 8 |
| Black images (macOS) | Set precision: bfloat16 in invokeai.yaml |
If the script fails to find the URL or authentication token, you can set or ask the user to set environment variables:
export INVOKEAI_API_URL='http://localhost:9090'
export INVOKEAI_AUTH_TOKEN='your-token' # Optional
Resources
scripts/generate.py- Main generation script
FAQ
What does the invokeai-image-gen skill do?
Generate images using InvokeAI's local API. Use when asked to generate, create, or make images with InvokeAI, FLUX.2 Klein, Z-Image Turbo, FLUX, or SDXL models. Supports text-to-image generation, automatic model detection, image download, and parameter selection based on model architecture.
How do I install invokeai-image-gen?
Run npx skills add https://github.com/sammcj/agentic-coding --skill invokeai-image-gen in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/invokeai-image-gen/ (personal) or .claude/skills/invokeai-image-gen/ (project).
Which AI agents can use invokeai-image-gen?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is invokeai-image-gen safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains invokeai-image-gen?
It is published by sammcj in sammcj/agentic-coding. It has 63 recorded installs.
More from sammcj/agentic-coding
critical-thinking-logical-reasoning
sammcj/agentic-coding
Critically analyse the reasoning in written content (articles, blogs, transcripts, reports), not code. Use only when explicitly asked to critically analyse or critique an argument.
writing-documentation-with-diataxis
sammcj/agentic-coding
Applies the Diataxis framework to create or improve technical documentation. Use when being asked to write high quality tutorials, how-to guides, reference docs, or explanations, when reviewing documentation quality, or when deciding what type of documentation to create. Helps identify documentation types using the action/cognition and acquisition/application dimensions.
creating-development-plans
sammcj/agentic-coding
Creates structured development plans with phased task breakdowns, requirements, and QA checklists. Use when the user explicitly asks to create a dev plan, development plan, or document development requirements.
ghostty-config
sammcj/agentic-coding
Open the skill to read its SKILL.md instructions.
code-simplification
sammcj/agentic-coding
Open the skill to read its SKILL.md instructions.
prompt-enhancer
sammcj/agentic-coding
Open the skill to read its SKILL.md instructions.
Popular media & creative skills
hyperframes
heygen-com/hyperframes
Read first to make, edit, animate or render any video with HyperFrames (HTML rendered to video), including launch films, explainers, music videos, charts, maps, vertical clips, title cards, captions and overlays. Holds the render contract, the work loop and what each kind of video needs.
media-use
heygen-com/hyperframes
Get or make any media for a HyperFrames video - music, sound effects, images, icons, logos, voiceover, avatar and generated video, transcripts, cutouts, colour grades and looks - with HeyGen or free local tools, and mix placed audio. Also for footage that looks dark, flat or dull, or should be stylized or hidden.
hyperframes-registry
heygen-com/hyperframes
About 450 ready-made HyperFrames blocks and components installed as editable source - transitions, overlays, titles, kinetic type, captions, charts, map overlays, 3D, camera moves. Use it before hand-building any named visual (CRT scanlines, glitch, film grain, a chart); also for hyperframes add and catalog.
hyperframes-creative
heygen-com/hyperframes
Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use hyperframes-animation.
ai-video-generation
101-skills/superpowers
Generate AI videos with Google Veo, Seedance 2.0, HappyHorse, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 2.0, HappyHorse 1.0, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, reference-to-video, video editing, lipsync, avatar animation, video upscaling, foley sound. Use for: social media videos, marketing content, explainer videos, product demos, AI avatars. Triggers: video generation, ai video, text to video, image to video, veo, animate image, video from image, ai animation, video generator, generate video, t2v, i2v, ai video maker, create video with ai, runway alternative, pika alternative, sora alternative, kling alternative, seedance, happyhorse
ai-image-generation
101-skills/superpowers
Generate AI images with GPT-Image-2, FLUX, Gemini, Grok, Seedream, Reve and 50+ models via inference.sh CLI. Models: GPT-Image-2, FLUX Dev LoRA, FLUX.2 Klein LoRA, Gemini 3 Pro Image, Grok Imagine, Seedream 4.5, Reve, ImagineArt. Capabilities: text-to-image, image-to-image, inpainting, LoRA, image editing, upscaling, text rendering. Use for: AI art, product mockups, concept art, social media graphics, marketing visuals, illustrations. Triggers: flux, image generation, ai image, text to image, stable diffusion, generate image, ai art, midjourney alternative, dall-e alternative, text2img, t2i, image generator, ai picture, create image with ai, generative ai, ai illustration, grok image, gemini image, gpt image, openai image, chatgpt image