← 返回
未分类 Key 中文

xAI Studio

xAI Studio — generate and edit images and videos via the xAI API. Image: text-to-image, batch generation, multi-image editing, concurrent style transfers, mu...
xAI Studio — 通过 xAI API 生成和编辑图片与视频。图像功能包括文字生成图片、批量生成、多图编辑、并发风格迁移等。
h0llyw00dzz h0llyw00dzz 来源
未分类 clawhub v0.2.2 1 版本 100000 Key: 需要
★ 0
Stars
📥 641
下载
💾 0
安装
1
版本
#latest

概述

xAI Studio

Generate and edit images and videos using xAI's models via the xAI SDK.

Setup (Venv + SDK)

Create an isolated virtual environment and install the SDK:

python3 -m venv venv
source venv/bin/activate
pip3 install xai-sdk
deactivate

Generate Images

venv/bin/python3 scripts/run.py generate --prompt "A futuristic cityscape at dawn"

Generate multiple images in one request:

venv/bin/python3 scripts/run.py generate --prompt "Abstract art" --count 4

Edit Images

Edit an existing image with a text prompt:

venv/bin/python3 scripts/run.py edit --prompt "Make it a watercolor painting" --image photo.png

Combine up to 3 source images:

venv/bin/python3 scripts/run.py edit --prompt "Add the cat to the landscape" --image cat.png --image landscape.png

Concurrent Style Transfers

Apply multiple styles to the same image in parallel:

venv/bin/python3 scripts/run.py concurrent --image photo.png --prompt "oil painting" --prompt "pencil sketch" --prompt "pop art"

Multi-Turn Editing

Chain edits sequentially — each output feeds into the next:

venv/bin/python3 scripts/run.py multi-turn --image photo.png --prompt "Add dramatic clouds" --prompt "Make it a sunset"

Common Flags

  • --model: Model name (default: grok-imagine-image)
  • --aspect-ratio: e.g. 16:9, 4:3, auto (default: 1:1)
  • --resolution: 1k or 2k (default: API default)
  • --format: base64 (default) or url
  • --out-dir: Output directory (default: media/xai-output)

Output

Images are saved to //__., organized by UTC date. The prefix reflects the subcommand: generate, edit, style (concurrent), or step (multi-turn). The file extension is detected automatically from image magic bytes (PNG, JPEG, WebP, GIF).


Video: Generate

# Text-to-video
venv/bin/python3 scripts/run.py video-generate --prompt "A rocket launching from Mars" --duration 10 --resolution 720p

# Image-to-video
venv/bin/python3 scripts/run.py video-generate --prompt "Animate this scene" --image photo.png --duration 5

Video: Edit

venv/bin/python3 scripts/run.py video-edit --prompt "Add a silver necklace" --video https://example.com/clip.mp4

Video: Concurrent Edits

venv/bin/python3 scripts/run.py video-concurrent --video https://example.com/clip.mp4 --prompt "Add a hat" --prompt "Change outfit to red"

Video Flags

  • --model: Model name (default: grok-imagine-video)
  • --duration: Length in seconds, 1–15 (default: 5) — generate only
  • --aspect-ratio: e.g. 16:9 (default: API default)
  • --resolution: 480p or 720p (default: API default)
  • --timeout: Max polling wait in seconds (default: SDK default)
  • --poll-interval: Seconds between status checks (default: SDK default)

Videos are saved as .mp4 to //__.mp4. The prefix reflects the subcommand: video (generate), video_edit, or video_style (concurrent).

版本历史

共 1 个版本

  • v0.2.2 当前
    2026-05-01 21:27 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

UI/UX Pro Max

xobi667
提供 UI/UX 设计智能与实现指导,帮助打造精美界面。适用于 UI 设计、UX 流程、信息架构、视觉风格、设计系统/标记、组件规格、文案/微文案、无障碍及前端 UI(HTML/CSS/JS、React、Next.js、Vue、Svelte
★ 224 📥 48,558
design-media

Video Frames

steipete
使用 ffmpeg 从视频中提取帧或短片。
★ 136 📥 53,127
design-media

Openai Whisper

steipete
使用 Whisper CLI 进行本地语音转文字(无需 API 密钥)
★ 334 📥 94,481