Grok Image Generation
/install grok-image-generation
Grok Image Generation
Use the local scripts in this skill when the user specifically wants Grok/xAI for image generation or editing.
Quick workflow
- Confirm
XAI_API_KEYexists in the local environment. - For new images, run
scripts/grok_imagine.py generate .... - For edits or variations from source images, run
scripts/grok_imagine.py edit ...with one to three--imageor--image-urlinputs. - Save outputs under a task-specific folder when the user names a destination; otherwise use the default
output/grok-images/. - If prompts are weak or generic, read
references/prompt-templates.mdand improve them before generating.
Commands
Run from the skill directory or give absolute paths.
Generate
py -3 scripts\grok_imagine.py generate "A retro sci-fi poster with a giant moon" --aspect-ratio 2:3 --resolution 2k --n 1
Batch variations
py -3 scripts\grok_imagine.py generate "A clean premium mockup of a horror-movie T-shirt design" --n 4 --aspect-ratio 1:1
Edit one source image
py -3 scripts\grok_imagine.py edit "Turn this into a vintage pulp-poster illustration" --image C:\path o\source.png --resolution 2k
Combine multiple references
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
Prompting rules
- State what must be preserved before what must change.
- For products and mockups, prioritize subject accuracy and readability.
- For T-shirt art, ask for strong silhouette, high contrast, and print-friendly detail.
- For batches, request meaningful variation in composition, angle, and lighting.
- For edits, keep the instruction narrow unless the user wants radical transformation.
Read references/prompt-templates.md when you need a starting prompt pattern.
Editing and variations
Treat variation in three ways depending on the job:
- Same prompt, multiple fresh outputs -> use
generatewith--n > 1 - Same image, changed style or cleanup -> use
editwith one source image - Composite / transfer / merge references -> use
editwith two or three source images
Failure handling
- If xAI returns
403mentioning credits, licenses, or permissions, stop and tell the user billing/access is the blocker. - If returned image URLs are temporary, download them immediately; the script already does this.
- If xAI changes payload shape, update
scripts/grok_imagine.pyusingreferences/api-reference.mdplus the latest xAI docs.
Resources
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
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install grok-image-generation - 安装完成后,直接呼叫该 Skill 的名称或使用
/grok-image-generation触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Grok Image Generation 是什么?
Generate 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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 35 次。
如何安装 Grok Image Generation?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install grok-image-generation」即可一键安装,无需额外配置。
Grok Image Generation 是免费的吗?
是的,Grok Image Generation 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Grok Image Generation 支持哪些平台?
Grok Image Generation 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Grok Image Generation?
由 Stanislav Stankovic(@stanestane)开发并维护,当前版本 v1.0.0。