← 返回 Skills 市场
devvgwardo

Grok Imagine Video Generation

作者 DevGwardo · GitHub ↗ · v1.0.4
cross-platform ✓ 安全检测通过
1928
总下载
6
收藏
6
当前安装
5
版本数
在 OpenClaw 中安装
/install grok-imagine-video
功能描述
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.
使用说明 (SKILL.md)

Grok Imagine Video

Generate videos using xAI's Grok Imagine API directly from your messaging interface.

Setup

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

For full installation instructions, see README.md

Quick setup:

# 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"

python3 - \x3C\x3C '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"

python3 - \x3C\x3C '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"

# Use the Python client
python3 - \x3C\x3C '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:

python3 - \x3C\x3C '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:

python3 - \x3C\x3C '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:

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:

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.

export XAI_API_KEY="sk-..."

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

See 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 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

安全使用建议
This skill appears to do what it claims (call xAI Grok Imagine APIs) and only asks for XAI_API_KEY. Before installing: 1) Verify the skill source (there is no homepage/official repo link in the registry entry) and, if possible, review the included Python file yourself. 2) Store XAI_API_KEY securely (do not paste a production key into untrusted environments). 3) Be aware that the skill will fetch user-supplied image/video URLs and will download generated media to filesystem paths you provide—avoid using sensitive internal URLs and restrict output paths to safe directories to reduce SSRF or data exposure risk. 4) Ensure the runtime has the 'requests' package available (README mentions it). 5) Consider using a scoped/test API key first to confirm behavior and costs, and check your account rate limits/content policy on console.x.ai.
功能分析
Type: OpenClaw Skill Name: grok-imagine-video Version: 1.0.4 The skill bundle provides a Python client for the xAI Grok Imagine API, enabling image and video generation/editing. All code and documentation align with the stated purpose, making legitimate API calls to `https://api.x.ai/v1` and handling file downloads to the local workspace. The `SKILL.md` does not contain any prompt injection attempts against the OpenClaw agent, nor does the Python code exhibit malicious behaviors like data exfiltration, unauthorized execution, or persistence. The `CHANGELOG.md` even notes the removal of unrelated and overly broad Bash permissions from a previous version, indicating good security hygiene.
能力评估
Purpose & Capability
Name/description, SKILL.md, README, API reference, and the included Python client all consistently target xAI's Grok Imagine image/video endpoints and only require an XAI_API_KEY. The requested env var is appropriate and expected for this purpose.
Instruction Scope
Runtime instructions and examples only call the x.ai API and download generated assets. However, the client will accept arbitrary image_url/video_url parameters and will fetch them (requests.get) and will write files to user-specified paths. This is expected for media tooling but carries operational/privacy concerns (user-provided URLs trigger outbound fetches; untrusted URLs could expose internal resources or cause SSRF-like issues if the agent runs in a privileged network).
Install Mechanism
No install spec is provided (instruction-only skill with an included Python module). No remote downloads or archive extraction occur during install. Note: README lists the 'requests' dependency but the skill does not declare or enforce dependencies in metadata.
Credentials
Only XAI_API_KEY is required and declared as the primary credential, which is proportional for a client that calls xAI APIs. The skill will transmit prompts, and any user-provided image/video URLs or uploaded data, to api.x.ai—so the API key authorizes these operations and should be treated as sensitive.
Persistence & Privilege
always is false and the skill does not request persistent/global privileges or modify other skills. It does create directories/files where instructed, which is normal for a media client.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install grok-imagine-video
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /grok-imagine-video 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
- Added support for text-to-image generation and image editing alongside existing video capabilities. - Updated skill description and documentation to include image generation/editing workflows. - Clarified setup, configuration, and best practices for both images and videos. - Added limits for image requests and detailed error handling for new features. - Included metadata for OpenClaw integration.
v1.0.3
- Added required environment variable documentation (`XAI_API_KEY`) to the skill manifest. - Declared `XAI_API_KEY` as the primary credential for clearer setup and integration. - No changes to functionality or APIs; documentation only.
v1.0.2
- Added local settings file: `.claude/settings.local.json` - Updated best practices and limits to reference 480p and 720p (removed 1080p) - Adjusted performance recommendations to prefer 480p for faster video generation - Updated documentation to reflect resolution and workflow changes
v1.0.1
- Initial public release of grok-imagine-video. - Added integration with xAI Grok Imagine Video API for text-to-video, image-to-video, and natural language video editing. - Added Python client script (grok_video_api.py) to handle video generation, status polling, and downloading. - Included detailed setup instructions, usage workflows, and API documentation references. - Supports async video job handling, progress updates, and auto-delivery in messaging platforms.
v1.0.0
Initial release: Integrates xAI Grok Imagine Video API for conversational video creation and editing. - Supports text-to-video, image-to-video animation, and natural language video editing. - Handles asynchronous video generation with progress updates and automatic delivery in chat. - Requires user-supplied xAI API key for secure access. - Provides Python examples for generating, polling, and downloading videos. - Includes setup, best practices, and error handling guidance. - Lists feature limits and troubleshooting tips for smooth operation.
元数据
Slug grok-imagine-video
版本 1.0.4
许可证
累计安装 6
当前安装数 6
历史版本数 5
常见问题

Grok Imagine Video Generation 是什么?

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. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1928 次。

如何安装 Grok Imagine Video Generation?

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

Grok Imagine Video Generation 是免费的吗?

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

Grok Imagine Video Generation 支持哪些平台?

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

谁开发了 Grok Imagine Video Generation?

由 DevGwardo(@devvgwardo)开发并维护,当前版本 v1.0.4。

💬 留言讨论