Seedance 2.5 Image-to-Video: First and Last Frame Control (2026)
说明与用途
Seedance 2.5 中使用指定首尾帧生成视频的自动化流程,包括图像准备、请求构造、错误处理和状态轮询。
问题
Users need to generate a video that starts and ends with specific images using Seedance 2.5, but the API has strict requirements for frame ordering, aspect ratio handling, and error responses.
结果
The recipe enables developers to reliably generate videos that start and end with specified images, avoiding common pitfalls such as incorrect frame_type usage and aspect_ratio errors.
工作流
- 1. Prepare two images (first and last frames).
- 2. Encode each image as a data URI or provide a public URL.
- 3. Build the JSON body: set model to "bytedance/seedance-2.5", include prompt, duration, resolution, and a frame_images array with one object for each frame, specifying frame_type as "first_frame" or "last_frame" and type as "image_url".
- 4. Do NOT include an aspect_ratio field; if omitted, the API derives it from the first frame. If you need a different ratio, use "adaptive".
- 5. POST to https://api.ofox.ai/v1/videos with Authorization header.
- 6. On 202 response, note the polling_url.
- 7. Poll the polling_url until status is terminal (e.g., "completed" or "failed").
- 8. Retrieve the final video URL from the response.
- 9. Handle 400 errors: ensure only one first_frame and one last_frame, and that last_frame is not sent without a first_frame.
- 10. Verify the output by comparing opening and closing frames if needed.
证据
Seedance 2.5 treats the last frame as a destination, not a hint.
Data URIs work, which matters more than it sounds: it means you can test first-last-frame generation without standing up a public image host first.
POST /v1/videos {model: bytedance/seedance-2.5, resolution: 480p, aspect_ratio: "16:9", frame_images: [first, last]} 400 invalid_request "The parameter ratio specified in the request is not valid."
- 记录日期: 2026-09-05T15:44:55.153Z