promptstringobrigatório
Describe the image. Refer to reference images as @Image1, @Image2, ...
kwaivgi/kling-image/v4Kling Image V4 by Kuaishou generates photorealistic images with accurate text rendering from a text prompt at native 2K, 4K or 8K resolution.
Testar o modelo
Selecione um exemplo para carregar as entradas e o resultado no playground.
{
"aspect_ratio": "16:9",
"prompt": "Event poster for a jazz night: a saxophonist silhouetted against a deep blue stage light, large title \"MIDNIGHT JAZZ\" in bold Art Deco letters, smaller line \"Friday 22 November · Blue Room · 9 PM\" at the bottom, grainy film texture."
}{
"aspect_ratio": "16:9",
"prompt": "Camera-like photograph of an elderly fisherman mending a net on a wooden pier at golden hour, weathered skin and knitted sweater in fine detail, shallow depth of field, 85mm lens."
}Kling Image V4 generates photorealistic images from a text prompt at native 2K, 4K or 8K, with sharp in-image text (up to about 2,000 characters, multilingual) and dense layouts.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Put any text to render in quotation marks. |
aspect_ratio | auto / 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9 | auto | auto picks a shape from the prompt and references. |
resolution | 2K / 4K / 8K | 2K | Native output resolution. |
num_images | 1–9 | 1 | Independent images, each billed. |
Billed per output image by resolution.
| Resolution | Per image |
|---|---|
| 2K (default) | $0.063 |
| 4K | $0.094 |
| 8K | $0.157 |
| Failed runs are not charged. |
Other Kling Image V4 endpoints: kwaivgi/kling-image/v4, kwaivgi/kling-image/v4/edit, kwaivgi/kling-image/v4/long-image.
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": "kwaivgi/kling-image/v4",
"prompt": "A faceted glass perfume bottle on wet black slate, soft rim light, a small card beside it printed with \"NOCTURNE\" in thin serif letters, macro product photography.",
"num_images": 1,
"resolution": "2K",
"aspect_ratio": "auto"
}
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.
promptstringobrigatórioDescribe the image. Refer to reference images as @Image1, @Image2, ...
num_imagesintegerNumber of independent images to generate (1-9).
Padrão: 1
Mínimo: 1
Máximo: 9
resolutionstringOutput resolution. 8K is native ultra-high resolution.
Padrão: "2K"
Valores possíveis: "2K", "4K", "8K"
aspect_ratiostringOutput frame shape. auto picks one from the prompt and references.
Padrão: "auto"
Valores possíveis: "auto", "16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3", "21:9"
{
"model": "kwaivgi/kling-image/v4",
"prompt": "A faceted glass perfume bottle on wet black slate, soft rim light, a small card beside it printed with \"NOCTURNE\" in thin serif letters, macro product photography.",
"num_images": 1,
"resolution": "2K",
"aspect_ratio": "auto"
}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/bcc829ad-1640-449e-9efa-04cf84da1d97/output/04854f77-94c7-469a-908e-4f743ba7ea16.png"
}
]