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.
Essayer le modèle
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 12
Que souhaitez-vous faire ensuite ?
Sélectionnez un exemple pour charger ses entrées et son résultat dans le 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.
Commencer à construire
Soumettez ce modèle via l'API Unified Run de SandBase.
# 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"Créez une clé API SandBase et définissez-la dans l'environnement de votre serveur. Toutes les requêtes utilisent l'authentification Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conservez la clé sur votre serveur. Ne l'exposez pas dans le code du navigateur et ne la committez pas dans un dépôt.
Faites un POST sur /v1/run avec cet ID de modèle et ses entrées. L'exemple de requête ci-dessus inclut la soumission et le polling.
Utilisez l'ID d'exécution renvoyé pour interroger jusqu'à ce que le statut soit completed, failed ou timeout. Ne lisez la sortie qu'une fois completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Passez une URL de fichier accessible publiquement dans le champ image, video ou audio du modèle. Les formats pris en charge et les limites sont indiqués à côté de chaque entrée du Playground.
Utilisez le contrôle upload ou replace sur les champs image pris en charge dans le Playground. Les champs URL vidéo acceptent une vidéo de conduite hébergée ; cela n'implique pas la prise en charge de l'importation vidéo.
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.
Par défaut : true
promptstringobligatoireText 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)
Par défaut : 5
Minimum : 3
Maximum : 16
resolutionstringOutput video resolution. Sets the per-second rate.
Par défaut : "720p"
Valeurs possibles : "540p", "720p", "1080p", "2K", "4K"
aspect_ratiostringThe aspect ratio of the output video.
Par défaut : "16:9"
Valeurs possibles : "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_urlsarrayobligatoireURLs 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"
]
}Une exécution terminée expose son résultat dans output. Ce qui suit est l'exemple enregistré du modèle, et non une nouvelle génération.
[
{
"url": "https://static.sandbase.ai/examples/ea55f5ce-2b72-4369-b2dd-7aae51f770e5/output/b65887af-add4-4aaa-a487-b0ed0c1fb9e3.mp4"
}
]