DevGwardo

Grok Imagine Video Generation

設計創意v1.0.4
作者:DevGwardo更新於 2026-05-11共 5 個版本 · 最新版本釋出於 2026-02-12grok-imagine-video@clawhub_devvgwardo/grok-imagine-video
圖片生成影片處理#Image Generation#Api Integration#Messaging

據 AlphaMoat 統計,截至 2026-09,Grok Imagine Video Generation 累計下載 3,195 次、獲 6 個星標,在全部 5,078 個 AI 技能中排名第 3,563 位,在「設計創意」分類(512 個)中排名第 329 位。

累計安裝
212
累計下載
3195
星標
6
全站排名
#3,563
全站前 71% · 「設計創意」前 65%
平台累計安裝累計下載星標評論
ClawHub ↗9431956-
SkillHub ↗21231016—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

透過 xAI Grok Imagine 生成或編輯圖像與影片。提示詞和提供的媒體會由 xAI 處理;僅提交獲准外部處理的素材,並在重用前檢查生成結果。

資料釋出於 2026-10-27

可以用來做什麼

  • 整理相關資訊或執行對應操作

什麼時候用

  • 使用者需要相關工作流時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

請使用Grok Imagine Video Generation幫助處理這個任務

月度資料趨勢

累計下載3195
1734251933032026-03 · 累計下載 18422026-05 · 累計下載 23372026-06 · 累計下載 25172026-07 · 累計下載 28562026-08 · 累計下載 30562026-09 · 累計下載 319526-0326-09
星標6
5662026-03 · 星標 52026-05 · 星標 62026-06 · 星標 62026-07 · 星標 62026-08 · 星標 62026-09 · 星標 626-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093195—6
2026-083056+7.0%6
2026-072856+13.5%6
2026-062517+7.7%6
2026-052337—6
2026-031842—5

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

6.5 KB · ClawHub v1.0.4
---
name: grok-imagine-video
description: xAI Grok Imagine API integration for image generation, text-to-video, image-to-video, and editing via natural language. Use when you need to generate images or videos from text prompts, edit existing images, animate static images into videos, or edit existing videos with natural language instructions. Supports conversational generation across messaging platforms with async polling, progress updates, and automatic delivery.
metadata: {"openclaw": {"requires": {"env": ["XAI_API_KEY"]}, "primaryEnv": "XAI_API_KEY"}}
---

# Grok Imagine Video

Generate videos using xAI's Grok Imagine API directly from your messaging interface.
展開全部(共 229 行)
## Setup

**Important:** You need your own xAI API key. Get it from https://console.x.ai/

For full installation instructions, see [README.md](README.md)

Quick setup:
```bash
# Set your xAI API key (YOUR key, not pre-configured)
export XAI_API_KEY="your-api-key-here"
```

## Capabilities

- **Text-to-image**: Generate images from text descriptions (up to 10 variations)
- **Image editing**: Modify images using natural language
- **Text-to-video**: Create videos from text descriptions
- **Image-to-video**: Animate static images into motion
- **Video editing**: Modify videos using natural language
- **Async generation**: Handles long-running video jobs with polling
- **Auto-delivery**: Downloads and delivers images/videos via chat

## Workflow

### 1. Image Generation

User says: "Create an image of a cyberpunk cityscape at night"

```bash
python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))
result = client.generate_image("A cyberpunk cityscape at night, neon lights reflecting on wet streets")
print(f"Image URL: {result}")
EOF
```

Images are generated instantly (no polling needed). Download promptly as URLs are temporary.

### 1b. Image Editing

User says: "Edit this image — make it look like a watercolor"

```bash
python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))
result = client.edit_image(
    image_url="https://example.com/photo.jpg",
    prompt="Make it look like a watercolor painting"
)
print(f"Edited image: {result}")
EOF
```

### 2. Text-to-Video

User says: "Generate a video of a sunset over the ocean"

```bash
# Use the Python client
python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))
result = client.text_to_video("A beautiful sunset over the ocean", duration=10)
print(f"Job started: {result['job_id']}")
EOF
```

### 3. Wait for Video Completion

Video generation takes 1-3 minutes. Poll with progress:

```bash
python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))

def progress(response):
    print(f"Polling... {'Done!' if 'video' in response else 'Pending'}")

final = client.wait_for_completion("request-id-here", progress_callback=progress)
print(f"Video ready: {final['video']['url']}")
EOF
```

### 4. Download and Deliver

Download the completed video to the workspace:

```bash
python3 - << 'EOF'
import os
import sys
sys.path.insert(0, 'scripts')
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(os.getenv("XAI_API_KEY"))
output = "/data/workspace/videos/sunset.mp4"
client.download_video(final, output)  # pass the full response dict
print(f"Downloaded: {output}")
EOF
```

## Image-to-Video

Animate an image:

```python
from grok_video_api import GrokImagineVideoClient

client = GrokImagineVideoClient(api_key)
result = client.image_to_video(
    image_url="https://example.com/photo.jpg",
    prompt="Make the clouds move slowly",
    duration=10
)
```

## Video Editing

Edit an existing video:

```python
result = client.edit_video(
    video_url="https://example.com/source.mp4",
    edit_prompt="Add a warm sunset filter and slow down to 50% speed"
)
```

## Configuration

**Important:** Get your own API key from https://console.x.ai/ - do NOT use pre-configured keys.

```bash
export XAI_API_KEY="sk-..."
```

For OpenClaw integration, add to workspace `.env` or manage via gateway config.

See [README.md](README.md) for complete setup instructions.

## Error Handling

Common errors and responses:

- **Unauthorized / API key not set**: → Get your key from https://console.x.ai/ and set `export XAI_API_KEY="your-key"` - See README.md for details
- **Rate limit**: "Too many requests" → Wait and retry
- **Content policy**: "Prompt violates content policies" → Rephrase prompt
- **Timeout**: Job took too long → Reduce duration or complexity

Always wrap API calls in try/except and provide user-friendly messages.

## Best Practices

**Prompt engineering (images):**
- Be descriptive: "A collage of London landmarks in a stenciled street-art style"
- Specify style: "Watercolor painting of a mountain lake at dawn"
- Use multiple variations (`n=4`) to explore interpretations

**Prompt engineering (videos):**
- Be specific: "A golden retriever running through a sunny meadow"
- Include camera movement: "Slow pan from left to right"
- Specify lighting: "Warm golden hour lighting"

**Performance:**
- Images generate instantly — no polling needed
- Use 480p for faster video generation, 720p for higher quality
- Keep videos under 10 seconds unless essential
- Start with text-to-video, then edit if needed

**User experience:**
- Images: deliver immediately after generation
- Videos: send progress updates: "Generating video... 45% complete"
- Estimate time for videos: "This takes about 2-3 minutes"
- Confirm delivery: "Here's your image/video!"

## Limits

- Images per request: 1-10
- Video duration: 1-15 seconds
- Video resolution: 480p (default) or 720p
- Rate limit: 60 requests/minute
- Max concurrent jobs: 15

See [references/api_reference.md](references/api_reference.md) for full API documentation.

## Integration with Other Skills

- Combine with `ffmpeg-video-editor` for post-processing (trimming, concatenation, filters)
- Use `fal-ai` for additional video effects
- Integrate with `image-generation` skills for source images

## Troubleshooting

**Job stuck in "pending"**: Check API key and quota

**Video generation slow**: Try 720p instead of 1080p

**Failed jobs**: Check error_code in response; see API reference

**Download errors**: Verify video_url is accessible and has not expired

「設計創意」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。