Install
openclaw skills install grok-image-generationGenerate new images and edit existing images with xAI Grok Imagine from a local OpenClaw workspace. Use when the user wants Grok/xAI as the image source for prompt-based image generation, batch variations, reference-image edits, style transfer, cleanup, background replacement, product art, poster concepts, or reusable local automation around xAI image APIs.
openclaw skills install grok-image-generationUse the local scripts in this skill when the user specifically wants Grok/xAI for image generation or editing.
XAI_API_KEY exists in the local environment.scripts/grok_imagine.py generate ....scripts/grok_imagine.py edit ... with one to three --image or --image-url inputs.output/grok-images/.references/prompt-templates.md and improve them before generating.Run from the skill directory or give absolute paths.
py -3 scripts\grok_imagine.py generate "A retro sci-fi poster with a giant moon" --aspect-ratio 2:3 --resolution 2k --n 1
py -3 scripts\grok_imagine.py generate "A clean premium mockup of a horror-movie T-shirt design" --n 4 --aspect-ratio 1:1
py -3 scripts\grok_imagine.py edit "Turn this into a vintage pulp-poster illustration" --image C:\path\to\source.png --resolution 2k
py -3 scripts\grok_imagine.py edit "Place the subject from image one into the lighting and palette of image two" --image C:\path\subject.png --image C:\path\style.png
Read references/prompt-templates.md when you need a starting prompt pattern.
Treat variation in three ways depending on the job:
generate with --n > 1edit with one source imageedit with two or three source images403 mentioning credits, licenses, or permissions, stop and tell the user billing/access is the blocker.scripts/grok_imagine.py using references/api-reference.md plus the latest xAI docs.scripts/grok_imagine.py - local generator/editor wrapper for xAIreferences/prompt-templates.md - reusable prompt skeletonsreferences/api-reference.md - current endpoint assumptions and payload shapes