You need to enable JavaScript to run this app.
Lake AI Service

Lake AI Service

Copy page
Download PDF
Video generation
Video Editing Enhanced Edition
Copy page
Download PDF
Video Editing Enhanced Edition

The enhanced version of the video editing online service combines input videos and reference images to perform targeted video replacement. It is suitable for scenarios such as advertising material remastering, product replacement, background redrawing, and creative video editing.

Operator introduction

Operator ID: las_video_seedance_replace

Application scenarios

Core capabilities

  • The current version supports several types of intelligent video editing tasks, including scene replacement (scene_replace), object replacement (object_replace), and person replacement (person_replace).
    • Scene replacement (scene_replace): Retains the people, products, actions, and shot structure in the original video, while replacing the background or environmental style.
    • Object replacement (object_replace): Replaces the target object in the video with a specified style or product based on a reference image.
    • Person replacement (person_replace): Replace the target person in the video with a specified person based on a reference image.

      warning

      • To use the person replacement feature, you must apply to enable the LAS asset managementfunction (allowlist feature, disabled by default) and set seedance_use_asset_api = true when submitting a person replacement task.
      • Required audio, video, or image assets for person replacement:
        • You can manually upload assets to the LAS asset library first, and then provide the asset to the operator by specifying the LAS asset ID when submitting the task.
        • You can also provide assets directly to the operator via HTTPS or TOS paths. In this scenario, LAS will automatically upload the asset to LAS asset management and use the asset ID as input. After the operator task is completed, the automatically uploaded asset will be cleaned up.
  • Ensures the quality and stability of video editing results.
    • Supports supplementing natural language editing constraints via user_prompt, such as retaining actions, removing watermarks, avoiding subtitles, or controlling details of the style.
    • Supports automatic evaluation and retry for a limited number of times, helping to achieve more stable replacement results with complex materials.
    • Supports returning the final video result and diagnostic file (result.json), making it convenient for the user to retain generated results and process information.

Effect showcase


[Person replacement]
  • Input video - Example 1
  • Reference image
    Image
  • Replacement result
  • Input video - Example 2
  • Reference image
    Image
  • Replacement result

[Environment and object replacement]
  • Input video

Scenario 1: Background replacement

  • Reference image
    Image
  • Output video

Scenario 2: Object replacement

  • Reference image
    Image
  • Output video

Supported regions

  • Beijing: cn-beijing
  • Shanghai: cn-shanghai
  • Guangzhou: cn-guangzhou

Operator performance

Sub-items
Performance impact description

Maximum RPM

600

Maximum concurrency

10

Processing time

Total processing time depends on the video duration, the number of reference images, the complexity of the replacement, whether retry is enabled, and the network environment.

  • Enabling retry (enable_retry) increases the success rate and stability of generation, but significantly increases overall processing time and cost.

Processing result quality

The quality of video content replacement processing results depends on whether a reference image is provided and the content of the reference image.

  • It is recommended to provide reference images as three-view diagrams plus detail close-ups. Especially for scene replacement, keeping the reference image's perspective and distance consistent with the original video can significantly increase the probability of successful replacement.

Input and output requirements

Input requirements

Subdivision
Details

Supported input data modalities

  • Video
  • Image
  • Audio

Input format: Video

  • Format: mp4, mov
  • Size: 2-15 seconds. The input size for a single video must not exceed 200 MB.
  • Resolution: 480p, 720p, 1080p
  • Dimensions:
    • Aspect ratio (width/height): [0.4, 2.5]
    • Width and height (px): [300, 6000]
    • Total pixel count: [640x640=409600, 2206×946=2086876], meaning the product of width and height must fall within the range [409600, 2086876].
  • Other: It is recommended to use video material with a clear subject and a relatively stable camera.

Input format: Image

  • Format: jpeg, png, webp, bmp, tiff, gif, heic, and heif.
  • Quantity: Supports input of 1-9 reference images.
  • Size: Each image must be less than 30 MB.
  • Resolution: Width and height (px): (300, 6000); aspect ratio (width/height): (0.4, 2.5)
  • Other: It is recommended that the reference images provided include three-view diagrams and detailed close-ups.

Input format: Audio

  • Format: wav, mp3
  • Size: Audio duration [2,15] seconds. Each audio file must not exceed 15 MB.

Input path requirements

Provide input data to the operator via request parameters video_url, image_urls, and audio_url. Currently, the following methods are supported: public URL, TOS path, and Base64 encoding (only supported for images and audio).

  • Public URL: A video URL accessible via the public network, with the format http/https.
  • TOS path: After uploading the data to be processed to a TOS Bucket under the same primary account and region as the current LAS service, you can provide the TOS path, with the format tos://bucket_name/demo.
  • Base64 encoding (only supported for images and audio): Convert the local file to a Base64 encoded string, then submit it to the model. Do not use Base64 encoding for large files.
    • Image input must follow the format: data:image/<image format>;base64,<Base64 encoding>. Note that <image format> must be in lowercase, for example, data:image/png;base64,{base64_image}.
    • Audio input must follow the format: data:audio/<audio format>;base64,<Base64 encoding>. Note that <audio format> must be in lowercase, for example, data:audio/wav;base64,{base64_audio}.
  • LAS asset ID: The ID used for generating real and virtual portraits in videos, following the format: asset://<asset-id> .
    • When using the LAS asset ID method, you must first apply to enable the LAS asset managementfunction (allowlist feature, disabled by default), and set seedance_use_asset_api = true when submitting the task.
    • When submitting various types of tasks, if the input material involves real-person audio, video, or images, you must first upload the material to the LAS asset library and provide the corresponding material to the model using the LAS asset ID. Otherwise, the task may be blocked.
    • After enabling the feature and uploading materials, you can view the list of asset groups in the LAS Console under asset management > Virtual Portrait Asset. On the asset group details page, you can obtain the specific asset's asset ID (asset-id), which can then be concatenated in the above format to be used as input for the operator.

Output requirements

Subdivision
Details

Output data modality

  • Video
  • Text (JSON file)

Output format: Video

  • Size: The output video duration is within the range of 4-15 seconds.
  • Aspect ratio: Original video ratio (default), 16:9, 9:16, 1:1, 4:3, 3:4, 21:9, 9:21.
  • Resolution: Supports setting to 480p, 720p, 1080p. If not set, the output will be processed automatically according to the input video.
    • If a unified output resolution is required, it is recommended to set the output resolution value via the seedance_resolution parameter.
    • If the output video resolution is not explicitly specified, it will match the input video resolution.

Output path: TOS

Specify the storage path for the operator's output results via the request parameter output_tos_path. Currently, setting to a TOS path is supported.

  • TOS path: A TOS Bucket directory with write permissions under the same primary account and region as the LAS service.

Billing instructions
  • Billing standards

    Sub-items
    Billing standards description

    Billing item

    Duration of input/output video.

    Billing type

    Pay-as-you-go billing, unit: CNY/second, billed hourly according to actual usage.

    Unit price

    Depends on the version of the service you select (basic version or enhanced version).

    warning

    • Total cost paid: In addition to the unit price, the total cost also depends on the duration and resolution of the input and output videos.
    • Only tasks that successfully generate videos will incur costs. No charges will be applied for scenarios where video generation fails due to review or other operational reasons.
  • Billing details
    Billing formula: Total cost = unit price * billing volume = unit price * (video duration * duration conversion coefficient)

    Version breakdown
    Unit price
    Scenario breakdown
    Billing item: video duration
    Duration conversion coefficient: is determined by video resolution

    Basic version

    1.6 CNY/second

    No input video

    Output video duration

    • 480P:0.465
    • 720P:1

    With input video

    (Input video duration + output video duration)/2

    • 480P:0.554
    • 720P:1.220

    Enhanced version

    2 CNY/second

    No input video

    Output video duration

    • 480P:0.465
    • 720P:1
    • 1080P:2.504

    With input video

    (Input video duration + output video duration)/2

    • 480P:0.580
    • 720P:1.220
    • 1080P:3.040
  • Billing example

    • Example scenario: Using the enhanced version of video generation, the input includes a reference video (duration: 5 seconds), the output video duration is 7 seconds, and the resolution is 1080p.
    • Cost details:
      Total cost = unit price * billing volume = 2 CNY/second * (5 seconds + 7 seconds)/2 * 3.040 = 36.48 CNY
  • Billing unit
    The billing unit displayed in the billing details for costs incurred by invoking this operator is "Video editing enhanced version". Please pay attention to this difference when reviewing your bill.

Caution and prerequisites

Details

Caution and prerequisites

Costs

Before calling an operator, you need to understand the model invocation costs associated with using the operator. For details, see Large model invocation billing.

Authentication (API Key)

Before calling an operator, you need to generate an API Key for operator invocation. It is recommended to configure the API Key as an environment variable to ensure safer operator calls. For details, see Obtain and configure API Key.

BaseURL

Before calling an operator, you need to determine the BaseURL for operator invocation based on the region where your current LAS service is deployed. This is used to configure the path parameter values for operator calls.
For details, see Obtain the Base URL. The Examples below are for reference only; when making actual calls, replace the path values with those corresponding to your region.

Rest API call

API usage instructions

The operator's API is an asynchronous task interface. You need to submit a task through the submit interface, then use the Poll interface to obtain the task status and retrieve the operator's processing results. Additionally, the operator supports asynchronous callback capability (Callback). You can set the callback parameter callback.url when initiating the operator task. LAS will send an HTTP POST notification to this URL. For guidance on using asynchronous callbacks, see Asynchronous callback API.

Submit

Interface description

You can submit asynchronous tasks by invoking the video editing enhanced version operator. This supports scene replacement, object replacement, and other video replacement editing operations based on input video and reference images or audio, and uploads the results to the specified TOS directory.

Request parameters

参数
类型
Required
示例值
描述
operator_id
string
Yes
las_video_seedance_replace
Operator ID
operator_version
string
Yes
v1
Operator version
data
VideoSeedanceReplaceReqParams
Yes
Video replacement request parameters
callback
Callback
Task status callback configuration. After configuring callback.url, a POST request will be sent to this address when the task status changes. If not configured, you can query the task status and result using Poll.

Response parameters

参数
类型
Example value
Description
metadata
metadata
Request metadata

Request example

# Please set OUTPUT_TOS_PATH to a tos path writable by this account
export OUTPUT_TOS_PATH="tos://path/to/seedance_replace_results"

curl --location "https://operator.las.ap-southeast-1.volces.com/api/v1/submit" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $LAS_API_KEY" \
--data '{
    "operator_id": "las_video_seedance_replace",
    "operator_version": "v1",
    "data": {
        "video_url": "https://${LAS_TOS_BUCKET}.${TOS_ENDPOINT}/operator_cards_serving/public/${LAS_ENVIRONMENT}/las_video_seedance_replace/v1/sample_input.mp4",
        "image_urls": [
            "https://${LAS_TOS_BUCKET}.${TOS_ENDPOINT}/operator_cards_serving/public/${LAS_ENVIRONMENT}/las_video_seedance_replace/v1/sample_reference.jpg"
        ],
        "output_tos_path": "$OUTPUT_TOS_PATH",
        "user_prompt": "请帮我把@视频1的背景替换成@图片1的风格,保持人物动作和商品一致性,除背景外不做任何更改,不要字幕。",
        "task_type": "scene_replace",
        "enable_retry": true,
        "max_retry_times": 2
    }
}'

Response example

{
  "metadata": {
    "task_id": "task-20260427143000-abc123",
    "task_status": "PENDING",
    "business_code": "0",
    "error_msg": ""
  }
}

Error code

HttpStatusCode

Error code

Error message

Description

400

Url.Invalid

The url is invalid.

The input video, reference image, or audio link is invalid.

400

Video.Invalid

The video file is invalid.

The video file is invalid or cannot be parsed.

400

Video.DownloadFailed

Video download failed.

Video download failed.

400

Video.FormatUnsupported

Video format not supported.

Video format not supported.

400

Video.DurationTooShort

Video duration is too short.

Video duration is below the minimum limit.

400

Video.DurationExceeded

Video duration exceeds maximum limit.

The video duration exceeds the maximum limit.

400

Video.FileTooLarge

Video file size exceeds maximum limit.

The video file is too large.

400

Parameter.Invalid

The parameter is invalid.

The parameter is invalid.

400

Video.Timeout

Video processing timeout.

Video processing timed out.

400

Video.UploadFailed

Video upload failed.

Failed to upload the resulting video.

400

Tos.AccessFailed

TOS access failed.

TOS access failed.

401

Authorization.Missing

Missing Authorization.

Authorization is missing.

401

ApiKey.InValid

The api key is invalid.

The API is invalid.

500

Internal.ServerError

Internal server error.

Internal server error, such as failure in generation, evaluation, or result assembly.

Poll

Interface description

Query the execution status and result of the video replacement task.

Request parameters

Name

Type

Required

Example value

Description

operator_id

string

Yes

las_video_seedance_replace

Operator ID

operator_version

string

Yes

v1

Operator version

task_id

string

Yes

task-xxx

Task ID

Response parameters

参数
类型
示例值
描述
metadata
metadata
Request metadata
data
VideoSeedanceReplaceResponse
Returned data

Request example

curl --location "https://operator.las.ap-southeast-1.volces.com/api/v1/poll" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $LAS_API_KEY" \
--data '{
    "operator_id": "las_video_seedance_replace",
    "operator_version": "v1",
    "task_id": "task-20260427143000-abc123"
}'

Response example

{
    "metadata": {
        "task_id": "task-20260427143000-abc123",
        "task_status": "COMPLETED",
        "submit_time": "2026-07-21T16:04:06+08:00",
        "end_time": "2026-07-21T16:04:06+08:00",
        "business_code": "0",
        "error_msg": ""
    },
    "data": {
        "output_video_tos_url": "tos://path/to/seedance_replace_results/run_id/generated/attempt_01.mp4",
        "output_video_url": "https://path/to/seedance_replace_results/run_id/generated/attempt_01.mp4",
        "selected_attempt_no": 1,
        "attempt_count": 1,
        "output_result_json_tos_url": "tos://path/to/seedance_replace_results/run_id/result.json",
        "output_result_json_url": "https://path/to/seedance_replace_results/run_id/result.json"
    }
}

Error code

HttpStatusCode

Error code

Error message

Description

400

Url.Invalid

The url is invalid.

The input video, reference image, or audio link is invalid.

400

Video.Invalid

The video file is invalid.

The video file is invalid or cannot be parsed.

400

Video.DownloadFailed

Video download failed.

Video download failed.

400

Video.FormatUnsupported

Video format not supported.

Video format not supported.

400

Video.DurationTooShort

Video duration is too short.

Video duration is below the minimum limit.

400

Video.DurationExceeded

Video duration exceeds maximum limit.

The video duration exceeds the maximum limit.

400

Video.FileTooLarge

Video file size exceeds maximum limit.

The video file is too large.

400

Parameter.Invalid

The parameter is invalid.

The parameter is invalid.

400

Video.Timeout

Video processing timeout.

Video processing timed out.

400

Video.UploadFailed

Video upload failed.

Failed to upload the resulting video.

400

Tos.AccessFailed

TOS access failed.

TOS access failed.

401

Authorization.Missing

Missing Authorization.

Authorization is missing.

401

ApiKey.InValid

The api key is invalid.

The API is invalid.

500

Internal.ServerError

Internal server error.

Internal service error.

Last updated: 2026.08.06 09:49:44