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.
Testar o modelo
PNG, JPEG, WebP, or GIF · 20 MiB maximum each · up to 12
O que você gostaria de fazer em seguida?
Selecione um exemplo para carregar as entradas e o resultado no 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.
Comece a construir
Envie este modelo pela 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"Crie uma chave da API SandBase e defina-a no ambiente do seu servidor. Todas as requisições usam autenticação Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Mantenha a chave no servidor. Não a exponha em código do navegador nem a comite em um repositório.
Faça POST para /v1/run com este ID de modelo e suas entradas. O exemplo de requisição acima inclui envio e polling.
Use o ID de execução retornado para fazer polling até que o status seja completed, failed ou timeout. Leia a saída somente após completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Passe uma URL de arquivo acessível publicamente no campo de imagem, vídeo ou áudio do modelo. Os formatos e limites suportados são mostrados ao lado de cada entrada do Playground.
Use o controle de upload ou substituição nos campos de imagem suportados no Playground. Campos de URL de vídeo aceitam um vídeo de condução hospedado; isso não implica suporte a upload de vídeo.
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.
Padrão: true
promptstringobrigatórioText 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)
Padrão: 5
Mínimo: 3
Máximo: 16
resolutionstringOutput video resolution. Sets the per-second rate.
Padrão: "720p"
Valores possíveis: "540p", "720p", "1080p", "2K", "4K"
aspect_ratiostringThe aspect ratio of the output video.
Padrão: "16:9"
Valores possíveis: "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_urlsarrayobrigatórioURLs 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"
]
}Uma execução concluída expõe seu resultado em output. O texto a seguir é o exemplo salvo do modelo, não uma nova geração.
[
{
"url": "https://static.sandbase.ai/examples/ea55f5ce-2b72-4369-b2dd-7aae51f770e5/output/b65887af-add4-4aaa-a487-b0ed0c1fb9e3.mp4"
}
]