Skip to main content

Blog

Seedance 2.5 Video Editing and Extension: Request Guide

Seedance 2.5 Video Editing and Extension: Request Guide

Editing a video and extending it use the same Seedance 2.5 task endpoint, but they need different duration values. For an edit, use omni_reference_task_type: "edit" with duration: -1. For an extension, use "extend" with an integer output duration from 4 to 30 seconds. Both operations use mode: "omni_reference", a source in video_urls, and aspect_ratio: "adaptive".

This guide follows the PiAPI Seedance 2.5 documentation checked on October 24, 2026. The examples prepare requests; they were not submitted for generation. They do not establish output quality, processing speed, or a measured success rate.

Choose the operation before writing the prompt

Edit means changing the visuals or audio of an existing video. For example: “In @video1, change the lighting to a warm golden hour.” The documented source length is 4–30 seconds, and duration: -1 lets the model determine the resulting length. Do not replace -1 with the source length in seconds: it is the required edit value.

Extend means continuing a source video forward or backward. For example: “Extend @video1 forward: the camera continues moving slowly along the river.” Its duration describes the requested output length, not a guaranteed number of seconds appended to the original file. Use an integer from 4 to 30.

Reference means generating a video guided by supplied media. Use omni_reference_task_type: "reference" for that intention. The default "auto" lets the model infer the operation, but a request can fail later if its parameters do not fit the inferred task. Declaring edit or extend allows the corresponding parameter checks at submission.

Keep the source, prompt, and shape consistent

Supply at least one source video in input.video_urls. The prompt token @video1 refers to the first entry in that array; @video2 refers to the second. Image and audio references have their own numbering. Preserve array order when saving a request or rebuilding it from a form.

Use a video you have permission to process, at a URL the service can retrieve. A local file path or a browser-only preview URL does not supply a remotely readable video. Keep the source available while the task uses it. If your application issues expiring links, account for queuing and processing when choosing their lifetime.

Editing and extension preserve the aspect ratio of the source selected by the model, so adaptive is the only accepted aspect-ratio value for these operations. The documentation says omitted required values are filled in for a declared edit or extension, while conflicting fixed values are rejected with HTTP 400. Sending the values explicitly makes the saved request easier to inspect.

Build an edit or extension request

Save the following Python 3 script as seedance-request.py. Set PIAPI_SOURCE_VIDEO_URL to your own accessible video URL before running it. The script validates local arguments and prints JSON; it makes no network request and cannot check the media duration or accessibility. Inspect those separately.

import argparse
import json
import os
from urllib.parse import urlsplit

parser = argparse.ArgumentParser()
parser.add_argument("operation", choices=["edit", "extend"])
parser.add_argument("--seconds", type=int)
args = parser.parse_args()
source = os.environ.get("PIAPI_SOURCE_VIDEO_URL", "")
url = urlsplit(source)
if url.scheme != "https" or not url.netloc:
    parser.error("Set PIAPI_SOURCE_VIDEO_URL to an accessible HTTPS video URL")
if args.operation == "edit" and args.seconds is not None:
    parser.error("An edit uses duration -1; omit --seconds")
if args.operation == "extend" and (
    args.seconds is None or not 4 <= args.seconds <= 30
):
    parser.error("An extension requires --seconds from 4 to 30")

prompt = (
    "In @video1, change the lighting to a warm golden hour"
    if args.operation == "edit" else
    "Extend @video1 forward: continue the existing camera movement"
)
print(json.dumps({
    "model": "seedance",
    "task_type": "seedance-2.5",
    "input": {
        "mode": "omni_reference",
        "omni_reference_task_type": args.operation,
        "prompt": prompt,
        "video_urls": [source],
        "aspect_ratio": "adaptive",
        "duration": -1 if args.operation == "edit" else args.seconds,
        "resolution": "720p"
    }
}, indent=2))
python3 seedance-request.py edit > seedance-edit.json
python3 seedance-request.py extend --seconds 8 > seedance-extend.json

Review the file for the operation you want, then submit that file once to POST https://api.piapi.ai/api/v1/task from your backend with your X-API-Key header. Keep the key out of browser code and committed files. Adapt the prompt to your actual source while keeping its edit or extension intent explicit. These examples select the standard seedance-2.5 task type.

Follow the saved task instead of creating a replacement

Save the returned data.task_id beside the request. Retrieve that task with GET /api/v1/task/{task_id} and inspect its status and result. The Seedance 2.5 integration reference lists video_url and video output fields. Do not treat an accepted create request as a completed video.

If a polling deadline expires, keep the ID and resume checking the same task when appropriate. A client timeout does not prove generation failed. The polling and webhook guide covers completion handling, and the retry-safety guide explains how to avoid creating duplicate tasks after an uncertain submission.

Diagnose the parameter mismatch

HTTP 400 with a declared edit: check for a fixed aspect ratio or a positive duration copied from a text-to-video request. Use adaptive and -1, and check that a source video is present. Other validation errors can also produce 400; preserve and read the response body.

Failure after submission: compare the prompt with omni_reference_task_type. The documentation says the model checks task intent again during processing. Declaring reference while asking to “extend forward” can create a mismatch. Read the task error before changing parameters and submitting another task.

A different output length than expected: an edit uses model-selected length; an extension requests output length. For edits, the documentation describes credit reservation based on source duration followed by settlement against the video actually produced. Video references also affect billing. Check the current pricing section and your task record before estimating a batch.

For seedance-2.5-less-restriction edits, the documentation separately requires auto_upload_assets: false so the source video remains directly readable for duration measurement. Do not silently switch the task type in the standard examples without checking that variant’s requirements.

Continue with the complete Seedance 2.5 API specification or explore the Seedance 2.5 product page. A useful first test changes one thing in a short source clip and keeps the source URL, exact prompt, operation, and task ID together for comparison.