de ByteDance

video 720p con sonido

bytedance/seedance-2.0-fast/video-edit
Seedance 2.0 Fast: generador de video con IA en línea
  • Hasta 720p
  • Con sonido
  • Hasta 9 imágenes de referencia
  • Crear video
  • Imagen a video
  • Referencias a video
  • Extender video
  • Editar video

Llámalo con el nombre de modelo bytedance/seedance-2.0-fast/video-edit en POST /jobs/createTask, desde 0,046 US$.

Nombre del modelobytedance/seedance-2.0-fast/video-edit
EndpointPOST https://api.popnow.ai/api/v1/jobs/createTask
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "bytedance/seedance-2.0-fast/video-edit",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "video_url": "https://media.popnow.ai/effects/flower-bloom-1abd6efb.mp4",
    "resolution": "720p"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

El input se genera a partir del esquema de abajo, así que pasa la validación tal cual. Cambia el prompt y los enlaces por los tuyos.

Precio

OpciónUSD por segundo
resolution 480p0,046 US$
resolution 720p0,097 US$

Facturación en USD · Todas las opciones y su precio: GET /models/bytedance/seedance-2.0-fast/video-edit

Límites

Resoluciones
480p · 720p
Audio de referencia
3
Imágenes de referencia
9
Clip de entrada más largo
15 s

Parámetros

Estos campos salen del mismo esquema con el que validamos cada solicitud. Los campos que no aparecen se rechazan.

  • promptstringObligatorio

    Describe lo que quieres crear.

    Rango
    Número de caracteres: ≥ 1
  • video_urlstringObligatorioCambia el precio

    El clip con el que trabajar.

    Rango
    Número de caracteres: ≥ 1 · video/mp4, video/webm, video/quicktime, video/x-m4v
  • reference_image_urlsarray<string>Opcional

    Imágenes de las personas, prendas o lugares que el resultado debe mantener.

    Rango
    Número de elementos: 1 – 9 · image/jpeg, image/png, image/webp, image/gif
  • reference_audio_urlsarray<string>Opcional

    Audio que imitar: una voz, una música o un ritmo.

    Rango
    Número de elementos: 1 – 3 · audio/mpeg, audio/wav, audio/mp4, audio/aac +3
  • resolutionstringOpcionalCambia el precio

    Elige un tamaño de salida disponible.

    Por defecto
    "720p"
    Valores permitidos
    "480p""720p"
  • generate_audiobooleanOpcional

    Añade sonido acorde a la imagen: voces, ambiente y efectos.

    Por defecto
    true
  • seedintegerOpcional

    Usa la misma semilla y los mismos ajustes para comparar resultados en condiciones más controladas.

    Rango
    0 – 2147483647
  • return_last_framebooleanOpcional

    Guarda también el último fotograma del clip como imagen.

    Por defecto
    false
  • bitrate_modestringOpcional

    Estándar, o alta para más nitidez y un archivo más pesado.

    Por defecto
    "standard"
    Valores permitidos
    "standard""high"
  • watermarkbooleanOpcional

    Agrega una marca de agua visible «Generado por IA».

    Por defecto
    false
Esquema JSON sin procesar
{
  "additionalProperties": false,
  "properties": {
    "bitrate_mode": {
      "default": "standard",
      "description": "Encoding bitrate of the delivered file: standard, or high for crisper detail and a larger file.",
      "enum": [
        "standard",
        "high"
      ],
      "type": "string"
    },
    "generate_audio": {
      "default": true,
      "description": "On: write a new soundtrack for the edited picture. Off: the edit comes back silent; the source clip’s own sound is not carried over.",
      "type": "boolean"
    },
    "prompt": {
      "description": "What to change in the source clip, then what must stay as it is. The source clip is @Video1; reference images are @Image1, @Image2 and reference audio @Audio1, numbered in upload order.",
      "minLength": 1,
      "type": "string"
    },
    "reference_audio_urls": {
      "items": {
        "contentMediaType": [
          "audio/mpeg",
          "audio/wav",
          "audio/mp4",
          "audio/aac",
          "audio/ogg",
          "audio/opus",
          "audio/flac"
        ],
        "type": "string"
      },
      "maxItems": 3,
      "minItems": 1,
      "type": "array"
    },
    "reference_image_urls": {
      "description": "Optional reference images that show the target look (a garment, a prop, a face or a palette), up to 9. They do not change the price.",
      "items": {
        "contentMediaType": [
          "image/jpeg",
          "image/png",
          "image/webp",
          "image/gif"
        ],
        "type": "string"
      },
      "maxItems": 9,
      "minItems": 1,
      "type": "array"
    },
    "resolution": {
      "default": "720p",
      "description": "Output resolution of the edited clip; the frame shape follows the source.",
      "enum": [
        "480p",
        "720p"
      ],
      "type": "string"
    },
    "return_last_frame": {
      "default": false,
      "description": "Also return the edited clip’s final frame as a separate image.",
      "type": "boolean"
    },
    "seed": {
      "description": "Random seed. Omit to let the model pick one.",
      "maximum": 2147483647,
      "minimum": 0,
      "type": "integer"
    },
    "video_url": {
      "contentMediaType": [
        "video/mp4",
        "video/webm",
        "video/quicktime",
        "video/x-m4v"
      ],
      "format": "uri",
      "minLength": 1,
      "type": "string"
    },
    "watermark": {
      "default": false,
      "description": "Add the model’s visible \"AI generated\" watermark to the video.",
      "type": "boolean"
    }
  },
  "required": [
    "prompt",
    "video_url"
  ],
  "type": "object"
}

Respuestas, consultas y callbacks

Todos los modelos funcionan igual: crea una tarea y luego consulta su estado o espera el callback.

Consulta el precio primero

cURL
curl -X POST https://api.popnow.ai/api/v1/jobs/quote \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "bytedance/seedance-2.0-fast/video-edit",
  "input": {
    "prompt": "A slow aerial shot drifting over a misty pine forest at sunrise",
    "video_url": "https://media.popnow.ai/effects/flower-bloom-1abd6efb.mp4",
    "resolution": "720p"
  }
}'

Antes de ejecutar, envía el mismo cuerpo de solicitud a POST /jobs/quote para consultar el costo estimado y el máximo en USD. La cotización no ejecuta tareas ni descuenta saldo.

Aceptada

HTTP
HTTP/1.1 202 Accepted

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "state": "queued"
  },
  "request_id": "req_example_create"
}

HTTP 202 significa que la tarea está aceptada: el máximo en USD queda reservado hasta la liquidación. Al aceptar una tarea, reservamos el importe máximo de la cotización en tu saldo de PopNow. Al terminar, cobramos el uso real sin superar la reserva y liberamos el resto. Si la tarea falla, liberamos el importe reservado.

Consultar estado

cURL
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Consulta cada pocos segundos espaciando cada vez más y para cuando state sea succeeded, failed, canceled o expired.

Tarea terminada

JSON
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "model": "bytedance/seedance-2.0-fast/video-edit",
    "state": "succeeded",
    "output": {
      "assets": [
        {
          "url": "https://cdn.popnow.ai/tasks/task_01k3m8x9q2z4v7n5p6r8s0t1w3/output.mp4?signature=FROM_RESPONSE",
          "expiresAt": "2026-10-17T12:20:00Z",
          "mime": "video/mp4",
          "width": 1280,
          "height": 720,
          "durationSeconds": 5
        }
      ]
    },
    "settled": true
  },
  "request_id": "req_example_record"
}

Descarga desde la url antes de expiresAt. ¿Necesitas un enlace nuevo más tarde? Pídelo con POST /common/download-url.

Verificar un callback

Node.js
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const app = express();
// express.raw keeps the exact bytes that were signed; express.json would not match.
app.post("/hooks/popnow", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.header("X-Webhook-Timestamp");
  const signature = req.header("X-Webhook-Signature") ?? "";
  const body = JSON.parse(req.body.toString("utf8"));
  const taskId = body.data?.taskId ?? body.task_id;
  const digest = createHash("sha256").update(req.body).digest("hex");
  const expected = createHmac("sha256", process.env.POPNOW_WEBHOOK_SECRET)
    .update(`${taskId}.${timestamp}.${digest}`)
    .digest("base64");
  const ok = expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
  // Check the signature first, then reject anything older than five minutes.
  if (!ok || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.status(401).end();
  res.status(200).end(); // answer fast, then fetch the task and store its files
});

Con callBackUrl te enviamos la tarea terminada. Comprueba la firma sobre el cuerpo sin procesar antes de fiarte de ella.

Enviar un archivo local

cURL
curl -X POST https://api.popnow.ai/api/v1/common/upload-url \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType": "image/png", "bytes": 482113}'

# PUT the file bytes to data.uploadUrl with every header in data.headers, then commit it:
curl -X POST https://api.popnow.ai/api/v1/files/$FILE_ID/commit \
  -H "Authorization: Bearer $POPNOW_API_KEY"
# The commit returns a popnow://f/... reference. Put it in any image, video or
# audio field of the task input instead of a public https URL.

Los enlaces https públicos funcionan tal cual. Los archivos locales pasan antes por upload-url y commit.