seedinteger
Random seed for reproducibility. If None, a random seed is chosen.
vidu/q4/reference-to-videoVidu Q4 Preview by Shengshu builds a 3 to 16 second video at up to 4K from up to 12 reference images and 3 voice clips, keeping characters, products, and voices consistent across the clip.
ลองใช้โมเดล
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 12
ต้องการทำอะไรต่อ
เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
{
"aspect_ratio": "16:9",
"prompt": "[@reference_image_1] waddles across the sunny sand of [@reference_image_2], stops at the shell, sniffs it curiously and flaps its small wings with a happy chirp as waves roll in.",
"reference_image_urls": [
"https://static.sandbase.ai/examples/ea55f5ce-2b72-4369-b2dd-7aae51f770e5/input/127f444c-b589-4225-9dd1-22597400ba65.png",
"https://static.sandbase.ai/examples/ea55f5ce-2b72-4369-b2dd-7aae51f770e5/input/5958a2b3-3eeb-479a-b5c2-65eeabee22fe.png"
]
}{
"aspect_ratio": "16:9",
"prompt": "Wide shot: [@reference_image_1] runs into the shallow water of [@reference_image_2], splashing playfully; the shot cuts to a low close-up as it shakes water off its wings and looks at the camera.",
"reference_image_urls": [
"https://static.sandbase.ai/examples/7eece669-a533-4f93-9ec4-87b5f3b1bc9d/input/4719d7e8-e9a5-4455-ad88-ab08b373e431.png",
"https://static.sandbase.ai/examples/7eece669-a533-4f93-9ec4-87b5f3b1bc9d/input/707fc0d7-dfd7-4a0f-9f74-ee94f420bf0e.png"
]
}Vidu Q4 Preview reference-to-video: build a 3–16 second clip at up to 4K from up to 12 reference images and 3 voice clips, keeping characters, products, and voices consistent.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 5,000 characters. Tag references as [@reference_image_1] and [reference_audio_1]. |
reference_image_urls | image URL[], required | — | 1–12 images of characters, products, objects, or locations. |
reference_audio_urls | audio URL[] | — | Up to 3 mp3 clips, 3–12 seconds each, for voice consistency. |
aspect_ratio | 16:9 / 9:16 / 4:3 / 3:4 / 1:1 | 16:9 | Output frame shape. |
audio | boolean | true | Generate dialogue and sound effects. Same price on or off. |
resolution | 540p / 720p / 1080p / 2K / 4K | 720p | Sets the per-second rate. |
duration | integer 3–16 | 5 | Output length in seconds. |
seed | integer | random | Fix it to compare prompt changes. |
You pay for output seconds: $0.045 at 540p, $0.095 at 720p, $0.12 at 1080p, $0.19 at 2K, $0.39 at 4K.
| Output | 540p | 720p | 1080p | 2K | 4K |
|---|---|---|---|---|---|
| 3s | $0.135 | $0.285 | $0.36 | $0.57 | $1.17 |
| 5s (default) | $0.225 | $0.475 | $0.60 | $0.95 | $1.95 |
| 8s | $0.36 | $0.76 | $0.96 | $1.52 | $3.12 |
| 16s | $0.72 | $1.52 | $1.92 | $3.04 | $6.24 |
Failed runs are not charged.
[@reference_image_2] holds the product.vidu/q4/image-to-video animates a single first frame. Vidu Q3 endpoints such as vidu/q3/reference-to-video/mix remain available.
เริ่มสร้าง
ส่งโมเดลนี้ผ่าน 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": "vidu/q4/reference-to-video",
"audio": true,
"prompt": "[@reference_image_1] walks along the beach at sunset holding [@reference_image_2], then turns to the camera and smiles.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"reference_image_urls": [
"https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference1.png",
"https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference2.png"
]
}
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 ที่โฮสต์ไว้; ไม่ได้หมายความว่าสามารถอัปโหลดวิดีโอได้
seedintegerRandom seed for reproducibility. If None, a random seed is chosen.
audiobooleanWhether to generate audio (dialogue and sound effects) with the video. When false, the output video is silent.
ค่าเริ่มต้น: true
promptstringจำเป็นText prompt for video generation, max 5000 characters. Refer to references by position: [@reference_image_1], [@reference_image_2], ... for images and [reference_audio_1], [reference_audio_2], ... for audio clips.
durationintegerDuration of the video in seconds (3-16)
ค่าเริ่มต้น: 5
ขั้นต่ำ: 3
สูงสุด: 16
resolutionstringOutput video resolution. Sets the per-second rate.
ค่าเริ่มต้น: "720p"
ค่าที่เป็นไปได้: "540p", "720p", "1080p", "2K", "4K"
aspect_ratiostringThe aspect ratio of the output video.
ค่าเริ่มต้น: "16:9"
ค่าที่เป็นไปได้: "16:9", "9:16", "4:3", "3:4", "1:1"
reference_audio_urlsarrayURLs of up to 3 mp3 reference audio clips (3-12 seconds each, max 50 MB) used to keep voices consistent.
reference_image_urlsarrayจำเป็นURLs of 1 to 12 reference images (png, jpeg, jpg, webp) used to keep characters, products, objects, or locations consistent.
{
"model": "vidu/q4/reference-to-video",
"audio": true,
"prompt": "[@reference_image_1] walks along the beach at sunset holding [@reference_image_2], then turns to the camera and smiles.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"reference_image_urls": [
"https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference1.png",
"https://storage.googleapis.com/falserverless/web-examples/vidu/new-examples/reference2.png"
]
}run ที่เสร็จสมบูรณ์จะแสดงผลลัพธ์ใน output ต่อไปนี้เป็นตัวอย่างที่บันทึกไว้ของโมเดล ไม่ใช่การสร้างใหม่
[
{
"url": "https://static.sandbase.ai/examples/ea55f5ce-2b72-4369-b2dd-7aae51f770e5/output/b65887af-add4-4aaa-a487-b0ed0c1fb9e3.mp4"
}
]