← 返回 Skills 市场
ademczuk

Grok Imagine

作者 ademczuk · GitHub ↗ · v1.1.0
cross-platform ⚠ suspicious
467
总下载
0
收藏
0
当前安装
4
版本数
在 OpenClaw 中安装
/install grok-imagine-extended
功能描述
Generate images and videos using xAI Grok Imagine Extended. Text-to-image, image editing, text-to-video, image-to-video. Use when: user asks to generate, cre...
使用说明 (SKILL.md)

\r \r

Grok Imagine Extended (xAI Image & Video Generation)\r

\r Generate images and videos from text prompts using the xAI API.\r \r

Image Generation\r

\r

python3 {baseDir}/scripts/generate_image.py --prompt "your image description" --filename "output.png"\r
```\r
\r
With options:\r
\r
```bash\r
python3 {baseDir}/scripts/generate_image.py --prompt "a cyberpunk city at night" --filename "city.png" --resolution 2k --aspect-ratio 16:9\r
```\r
\r
## Image Editing\r
\r
Single source image:\r
\r
```bash\r
python3 {baseDir}/scripts/generate_image.py --prompt "make it a watercolor painting" --filename "edited.png" -i "/path/to/source.jpg"\r
```\r
\r
Multiple source images (up to 3):\r
\r
```bash\r
python3 {baseDir}/scripts/generate_image.py --prompt "combine into one scene" --filename "combined.png" -i img1.png -i img2.png\r
```\r
\r
## Video Generation\r
\r
Text-to-video:\r
\r
```bash\r
python3 {baseDir}/scripts/generate_image.py --prompt "a cat walking through flowers" --filename "cat.mp4" --video --duration 5\r
```\r
\r
Image-to-video (animate a still):\r
\r
```bash\r
python3 {baseDir}/scripts/generate_image.py --prompt "add gentle camera zoom and wind" --filename "animated.mp4" --video -i photo.jpg --duration 5\r
```\r
\r
## Models\r
\r
| Model | Type | Cost |\r
|-------|------|------|\r
| `grok-imagine-image` | Image (default) | $0.02/img |\r
| `grok-imagine-image-pro` | Image (high quality) | $0.07/img |\r
| `grok-imagine-video` | Video (auto for --video) | $0.05/sec |\r
\r
Select model with `--model grok-imagine-image-pro`. Video mode always uses `grok-imagine-video`.\r
\r
## All Options\r
\r
| Flag | Description |\r
|------|-------------|\r
| `--prompt`, `-p` | Text description (required) |\r
| `--filename`, `-f` | Output path (required) |\r
| `-i` | Input image for editing/animation (repeatable, max 3 for images, 1 for video) |\r
| `--model`, `-m` | Image model (default: grok-imagine-image) |\r
| `--aspect-ratio`, `-a` | 1:1, 16:9, 9:16, 4:3, 3:4, etc. |\r
| `--resolution`, `-r` | Image: 1k/2k. Video: 480p/720p |\r
| `--n` | Number of images 1-10 (default 1) |\r
| `--video` | Generate video instead of image |\r
| `--duration`, `-d` | Video duration 1-15 seconds (default 5) |\r
| `--api-key`, `-k` | Override XAI_API_KEY |\r
\r
## API Key\r
\r
- `XAI_API_KEY` env var\r
- Or set `skills."grok-imagine".apiKey` / `skills."grok-imagine".env.XAI_API_KEY` in `~/.openclaw/openclaw.json`\r
- Or auto-read from `~/keys.txt`\r
\r
## Notes\r
\r
- Use timestamps in filenames: `2026-03-01-cyberpunk-city.png`\r
- The script prints a `MEDIA:` line for OpenClaw to auto-attach on supported chat providers\r
- Do not read the image back; report the saved path only\r
- Image URLs from xAI are temporary; the script downloads them immediately\r
- Video generation is async and polls until done (can take 1-5 minutes)\r
- 2k resolution returns PNG; 1k returns JPEG\r
安全使用建议
This skill appears to do what it says: call xAI's image/video endpoints, download media, and save files. Before installing, ensure you: (1) only provide an XAI_API_KEY you trust for image generation and monitor usage/costs (video polling can incur charges while it runs); (2) are comfortable with the script reading ~/keys.txt if that file exists (remove or secure it if not); (3) understand the skill will download remote media and write files to the provided output paths; and (4) note the SKILL.md mentions reading ~/.openclaw/openclaw.json but the bundled script does not — if you rely on that behavior, verify it or set the env/--api-key explicitly. Overall the package is coherent with its stated purpose.
功能分析
Type: OpenClaw Skill Name: grok-imagine-extended Version: 1.1.0 The skill is classified as suspicious primarily due to a critical path traversal vulnerability in `scripts/generate_image.py`. The `download_file` function writes to `output_path` which is directly derived from the user-controlled `--filename` argument without sanitization, allowing an attacker to write files to arbitrary locations (e.g., `../../../../tmp/malicious.txt`). Additionally, the script attempts to load the `XAI_API_KEY` from `~/keys.txt`, which, while intended for convenience, expands the attack surface for API key compromise if an attacker can manipulate that file via prompt injection.
能力评估
Purpose & Capability
Name/description, required XAI_API_KEY, endpoints (api.x.ai), and the provided script all align with an image/video generation skill. Required capabilities are proportional to the stated purpose.
Instruction Scope
Runtime instructions tell the agent to run the included script and only reference XAI_API_KEY, a local keys.txt fallback, and output paths. The script does network calls to the xAI API, downloads returned media to disk, and polls for video status as documented — all within the scope. Minor mismatch: SKILL.md also claims the key can be read from ~/.openclaw/openclaw.json, but the included script only implements env var, explicit --api-key, and ~/keys.txt lookup.
Install Mechanism
No install spec; the skill is instruction-only with a bundled script. Nothing is downloaded or executed at install time.
Credentials
Only XAI_API_KEY is required (declared as primary). The script optionally reads ~/keys.txt for a fallback key (documented). There are no unrelated secrets requested. Users should note the script will read keys.txt if present — ensure that file's contents and permissions are acceptable.
Persistence & Privilege
always is false and the skill does not request persistent/privileged presence or modify other skills or system-wide settings. Autonomous invocation is allowed but is the platform default.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install grok-imagine-extended
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /grok-imagine-extended 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
- Switched all usage examples from uv to python3 for running scripts. - Updated requirements: removed need to install uv and related instructions. - Changed metadata to only require XAI_API_KEY environment variable (removed bins/uv). - Removed OpenClaw-specific notes and instructions about media line and script interaction. - No changes to command-line options, features, or overall functionality.
v1.0.2
No user-facing changes in this release. - No file changes detected compared to the previous version. - Functionality and documentation remain the same.
v1.0.1
Version 1.0.1 - Updated API key auto-discovery: removed support for reading from C:/Projects/keys.txt (Windows). - SKILL.md and script instructions updated to reflect this change.
v1.0.0
Initial release: text-to-image, image editing (up to 3 sources), text-to-video, image-to-video via xAI Grok Imagine API. Models: grok-imagine-image, grok-imagine-image-pro, grok-imagine-video.
元数据
Slug grok-imagine-extended
版本 1.1.0
许可证
累计安装 0
当前安装数 0
历史版本数 4
常见问题

Grok Imagine 是什么?

Generate images and videos using xAI Grok Imagine Extended. Text-to-image, image editing, text-to-video, image-to-video. Use when: user asks to generate, cre... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 467 次。

如何安装 Grok Imagine?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install grok-imagine-extended」即可一键安装,无需额外配置。

Grok Imagine 是免费的吗?

是的,Grok Imagine 完全免费(开源免费),可自由下载、安装和使用。

Grok Imagine 支持哪些平台?

Grok Imagine 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Grok Imagine?

由 ademczuk(@ademczuk)开发并维护,当前版本 v1.1.0。

💬 留言讨论