# Wan VACE Video Edit > Edit an existing video from a text prompt — restyle scenes, swap subjects or backgrounds, and apply reference-image-guided changes while preserving the source motion. ## Overview - **Endpoint**: `https://queue.modelrunner.run/wan-video/wan-vace/video-edit` - **Model ID**: `wan-video/wan-vace/video-edit` - **Category**: video-to-video - **Kind**: inference - **Tags**: wan, wan-vace, alibaba, video-to-video, video-editing ## Pricing - **480p**: $0.05 per output second - **580p**: $0.075 per output second - **720p**: $0.1 per output second ## Request Lifecycle This model runs on the ModelRunner **asynchronous queue API** — a single POST does not return the output. Every call requires an `Authorization: Key $MODEL_RUNNER_KEY` header. Run three steps: 1. **Submit** — `POST https://queue.modelrunner.run/wan-video/wan-vace/video-edit` with a JSON body holding the input fields at the top level. The body may also include a reserved top-level `metadata` object — a flat string map (max 16 keys, key ≤64 / value ≤512 chars) stored on the request for your own tagging. It is never sent to the model; filter your request history with `GET https://queue.modelrunner.run/requests?metadata=` (exact key=value matches, AND-ed). The response carries request handles only (no output yet): ```json { "status": "IN_QUEUE", "request_id": "<21-char id>", "status_url": "https://queue.modelrunner.run/wan-video/wan-vace/video-edit/requests//status", "response_url": "https://queue.modelrunner.run/wan-video/wan-vace/video-edit/requests/", "cancel_url": "https://queue.modelrunner.run/wan-video/wan-vace/video-edit/requests//cancel" } ``` 2. **Poll status** — `GET ` until `status` is `COMPLETED`. Possible values are `IN_QUEUE`, `IN_PROGRESS`, `COMPLETED`, `FAILED`, `CANCELLED`. A `FAILED` request responds with HTTP 400 and an `error` field. 3. **Read result** — `GET `. Returns the finished request, including the generated `output`: ```json { "id": "", "status": "COMPLETED", "output": ..., "input": ... } ``` The JavaScript and Python SDKs below perform steps 2–3 for you. In any language without an SDK (Swift, Go, Kotlin, etc.) you must implement the polling loop and the final result fetch yourself — see the cURL example for the full flow. ### Input Schema - **`prompt`** (`string`, _required_): Prompt describing how to edit the video, in plain language (e.g. 'replace him with a large anthropomorphic polar bear'). - Example: `"replace him with a large anthropomorphic polar bear"` - **`video_url`** (`string`, _required_): URL of the input video to edit. - **`image_urls`** (`array`, _optional_): URLs of input images to use as visual references for the edit. - Default: `\[\]` - **`resolution`** (`ResolutionEnum`, _optional_): Output resolution. 480p bills at $0.05/second, 580p at $0.075/second, 720p (default) at $0.10/second. - Default: `"720p"` - Options: `"480p"`, `"580p"`, `"720p"` - **`video_type`** (`VideoTypeEnum`, _optional_): The type of video you're editing. Use 'general' for most videos, and 'human' for videos emphasizing human subjects and motions. The default 'auto' lets the model guess based on the first frame. - Default: `"auto"` - Options: `"auto"`, `"general"`, `"human"` - **`acceleration`** (`AccelerationEnum`, _optional_): Acceleration to use for inference. Accelerated inference very slightly affects the output but is significantly faster. - Default: `"regular"` - Options: `"none"`, `"low"`, `"regular"` - **`aspect_ratio`** (`AspectRatioEnum`, _optional_): Aspect ratio of the edited video. - Default: `"auto"` - Options: `"auto"`, `"16:9"`, `"9:16"`, `"1:1"` - **`return_frames_zip`** (`boolean`, _optional_): Whether to also return a ZIP archive containing all generated frames. - Default: `false` - **`enable_auto_downsample`** (`boolean`, _optional_): Whether to enable automatic downsampling for high frame rate or long videos. The video is interpolated back to the original frame rate after generation. - Default: `true` - **`auto_downsample_min_fps`** (`number`, _optional_): The minimum frames per second to downsample the video to. - Default: `15` - Range: `1` to `60` ### Output Schema _No `Output` schema properties are available._ ## Default Example **Input** ```json { "prompt": "restyle the entire clip as a hand-painted watercolor animation with soft pastel colors", "video_url": "https://media.modelrunner.ai/5JxlhK5OqnmatOg5-wan-vace-dog-2p5s.mp4", "image_urls": [], "resolution": "480p", "video_type": "auto", "acceleration": "regular", "aspect_ratio": "auto", "return_frames_zip": false, "enable_auto_downsample": true, "auto_downsample_min_fps": 15 } ``` **Output** ```json "https://media.modelrunner.ai/fEuUOr8ZNPU3RjK3m9iG1.mp4" ``` ## Usage Examples ### cURL The queue API is asynchronous: submit the request, poll `status_url` until it is `COMPLETED`, then read the result from `response_url`. Requires `jq`. ```bash # 1. Submit the request (returns request handles, not the output) SUBMIT=$(curl --silent --request POST \ --url https://queue.modelrunner.run/wan-video/wan-vace/video-edit \ --header "Authorization: Key $MODEL_RUNNER_KEY" \ --header "Content-Type: application/json" \ --data '{ "prompt": "restyle the entire clip as a hand-painted watercolor animation with soft pastel colors", "video_url": "https://media.modelrunner.ai/5JxlhK5OqnmatOg5-wan-vace-dog-2p5s.mp4", "image_urls": [], "resolution": "480p", "video_type": "auto", "acceleration": "regular", "aspect_ratio": "auto", "return_frames_zip": false, "enable_auto_downsample": true, "auto_downsample_min_fps": 15 }') STATUS_URL=$(echo "$SUBMIT" | jq -r '.status_url') RESPONSE_URL=$(echo "$SUBMIT" | jq -r '.response_url') # 2. Poll until the request leaves the queue / in-progress state while true; do STATUS=$(curl --silent --url "$STATUS_URL" \ --header "Authorization: Key $MODEL_RUNNER_KEY" | jq -r '.status') echo "Status: $STATUS" case "$STATUS" in COMPLETED) break ;; FAILED|CANCELLED) echo "Request $STATUS"; exit 1 ;; esac sleep 1 done # 3. Read the finished request, including the generated output curl --silent --url "$RESPONSE_URL" \ --header "Authorization: Key $MODEL_RUNNER_KEY" ``` ### JavaScript ```javascript import { modelrunner } from "@modelrunner/client"; const result = await modelrunner.subscribe("wan-video/wan-vace/video-edit", { input: { "prompt": "restyle the entire clip as a hand-painted watercolor animation with soft pastel colors", "video_url": "https://media.modelrunner.ai/5JxlhK5OqnmatOg5-wan-vace-dog-2p5s.mp4", "image_urls": [], "resolution": "480p", "video_type": "auto", "acceleration": "regular", "aspect_ratio": "auto", "return_frames_zip": false, "enable_auto_downsample": true, "auto_downsample_min_fps": 15 } }); console.log(result.data); ``` ### Python ```python import asyncio import modelrunner_ai async def main(): response = await modelrunner_ai.submit_async( "wan-video/wan-vace/video-edit", arguments={ "prompt": "restyle the entire clip as a hand-painted watercolor animation with soft pastel colors", "video_url": "https://media.modelrunner.ai/5JxlhK5OqnmatOg5-wan-vace-dog-2p5s.mp4", "image_urls": [], "resolution": "480p", "video_type": "auto", "acceleration": "regular", "aspect_ratio": "auto", "return_frames_zip": false, "enable_auto_downsample": true, "auto_downsample_min_fps": 15 } ) result = await response.get() print(result["output"]) asyncio.run(main()) ``` ## Additional Resources - [Playground](https://modelrunner.ai/models/wan-video/wan-vace/video-edit) - [OpenAPI Schema](https://modelrunner.ai/models/wan-video/wan-vace/video-edit/openapi.json) - [LLM Instructions](https://modelrunner.ai/models/wan-video/wan-vace/video-edit/llms.txt)