imagesarrayจำเป็น
One or more reference image URLs to guide the video generation as style and content references. Reference in prompt as <IMAGE_0>, <IMAGE_1>, etc. Maximum 7 images.
xai/grok-imagine-video/1.5/reference-to-videoGrok Imagine Video 1.5 is xAI's image-to-video AI model. Bring static images to life with fluid animation, consistent character motion, and professional-grade video output.
ลองใช้โมเดล
PNG, JPEG, WebP, or GIF · 20 MiB maximum each
ต้องการทำอะไรต่อ
เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
{
"duration": 1,
"images": [
"https://static.sandbase.ai/examples/182071c8-4a68-49d6-8ddb-2e1ba5af7d4d/input/2e71e37f-fbf8-44ba-a7ad-c1a366f777bd.png"
],
"prompt": "the subject walks forward",
"resolution": "480p"
}Grok Imagine Video 1.5 reference-to-video: reference images keep characters and objects consistent in a 1–15 second clip.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 4,096 characters. |
aspect_ratio | 21:9 / 16:9 / 3:2 / 4:3 / 5:4 / 1:1 / 4:5 / 3:4 / 2:3 / 9:16 | — | Output frame shape. |
resolution | 480p / 720p | 720p | Sets the per-second rate. |
duration | integer 1–15 | 8 | Output length in seconds. |
images | image URL[], required | — | Reference images, Image 1, Image 2, … |
Per output second: $0.08 at 480p and $0.14 at 720p, plus $0.01 per reference image.
| Output | 480p | 720p |
|---|---|---|
| 8s (default) | $0.65 | $1.13 |
| 15s | $1.21 | $2.11 |
Failed runs are not charged.
Other Grok Imagine Video 1.5 endpoints: xai/grok-imagine-video/1.5/text-to-video, xai/grok-imagine-video/1.5/image-to-video, xai/grok-imagine-video/1.5/lite/text-to-video, xai/grok-imagine-video/1.5/lite/image-to-video, xai/grok-imagine-video/text-to-video (previous version).
เริ่มสร้าง
ส่งโมเดลนี้ผ่าน SandBase Unified Run API
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "xai/grok-imagine-video/1.5/reference-to-video",
"prompt": "The person from <IMAGE_0> walks through a rainy neon-lit street.",
"duration": 8,
"resolution": "720p"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"สร้าง SandBase API key และตั้งค่าไว้ในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอทั้งหมดใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์หรือคอมมิตลง repository
POST ไปที่ /v1/run ด้วย model ID นี้และอินพุตของมัน ตัวอย่างคำขอด้านบนมีทั้งการส่งและการ polling
ใช้ run ID ที่ส่งกลับมาเพื่อ polling จนกว่าสถานะจะเป็น completed, failed หรือ timeout ให้อ่าน output หลังจาก completed เท่านั้น
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"ส่ง URL ไฟล์ที่เข้าถึงได้สาธารณะในช่อง image, video หรือ audio ของโมเดล รูปแบบและข้อจำกัดที่รองรับแสดงอยู่ข้างแต่ละอินพุตใน Playground
ใช้ตัวควบคุม upload หรือ replace ในช่องรูปภาพที่รองรับใน Playground ช่อง URL ของวิดีโอรองรับวิดีโอ driving ที่โฮสต์ไว้; ไม่ได้หมายความว่าสามารถอัปโหลดวิดีโอได้
imagesarrayจำเป็นOne or more reference image URLs to guide the video generation as style and content references. Reference in prompt as <IMAGE_0>, <IMAGE_1>, etc. Maximum 7 images.
promptstringจำเป็นText prompt describing the video. Tag references as <IMAGE_0>, <IMAGE_1>, etc.
durationintegerVideo duration in seconds.
ค่าเริ่มต้น: 8
ขั้นต่ำ: 1
สูงสุด: 15
resolutionstringResolution of the output video.
ค่าเริ่มต้น: "720p"
ค่าที่เป็นไปได้: "480p", "720p"
aspect_ratiostringThe aspect ratio of the generated image.
ค่าที่เป็นไปได้: "21:9", "16:9", "3:2", "4:3", "5:4", "1:1", "4:5", "3:4", "2:3", "9:16"
{
"model": "xai/grok-imagine-video/1.5/reference-to-video",
"prompt": "The person from <IMAGE_0> walks through a rainy neon-lit street.",
"duration": 8,
"resolution": "720p"
}run ที่เสร็จสมบูรณ์จะแสดงผลลัพธ์ใน output ต่อไปนี้เป็นตัวอย่างที่บันทึกไว้ของโมเดล ไม่ใช่การสร้างใหม่
[
{
"poster": "https://static.sandbase.ai/examples/posters/d087fb8ab1ef444377f3.jpg",
"source": "Completed user prediction (human visual safety screened)",
"source_url": "https://www.sandbase.ai",
"url": "https://static.sandbase.ai/examples/182071c8-4a68-49d6-8ddb-2e1ba5af7d4d/output/95798e92-c36f-4ca4-bd1a-bcff7dcee1ca.mp4"
}
]