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.
Thử model
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 12
Bạn muốn làm gì tiếp theo?
Chọn một ví dụ để nạp đầu vào và kết quả của nó vào 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.
Bắt đầu xây dựng
Gửi model này qua 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"Tạo một SandBase API key và đặt nó trong môi trường máy chủ của bạn. Tất cả request sử dụng xác thực Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Giữ key trên máy chủ. Không hiển thị trong mã trình duyệt hoặc commit vào repository.
POST tới /v1/run với model ID này và các đầu vào của nó. Ví dụ request ở trên bao gồm cả bước gửi và polling.
Dùng run ID được trả về để poll cho đến khi trạng thái là completed, failed hoặc timeout. Chỉ đọc đầu ra sau khi completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Cung cấp một URL tệp có thể truy cập công khai trong trường image, video hoặc audio của model. Các định dạng và giới hạn được hỗ trợ hiển thị bên cạnh từng input trong Playground.
Dùng điều khiển upload hoặc replace trên các trường image được hỗ trợ trong Playground. Trường URL video chấp nhận một video driving được host; điều này không đồng nghĩa hỗ trợ tải lên video.
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.
Mặc định: true
promptstringbắt buộcText 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)
Mặc định: 5
Tối thiểu: 3
Tối đa: 16
resolutionstringOutput video resolution. Sets the per-second rate.
Mặc định: "720p"
Giá trị có thể dùng: "540p", "720p", "1080p", "2K", "4K"
aspect_ratiostringThe aspect ratio of the output video.
Mặc định: "16:9"
Giá trị có thể dùng: "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_urlsarraybắt buộcURLs 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"
]
}Một run đã hoàn tất sẽ hiển thị kết quả trong output. Phần sau là ví dụ đã lưu của model, không phải một lần tạo mới.
[
{
"url": "https://static.sandbase.ai/examples/ea55f5ce-2b72-4369-b2dd-7aae51f770e5/output/b65887af-add4-4aaa-a487-b0ed0c1fb9e3.mp4"
}
]