seedinteger
Random seed for reproducibility.
Minimum: 0
Maximum: 2147483647
alibaba/wan/2.2/animate/replaceWan 2.2 Animate Replace replaces the person in the reference video with the character from the image.
Try the model
PNG, JPEG, WebP, or GIF · 20 MiB maximum
Customize your input with more control.
What would you like to do next?
Select an example to load its inputs and result into the playground.
{
"image": "https://static.sandbase.ai/examples/874ae93a-9288-40dc-b214-6c73426b2d22/input/e9a4fdfa-de1e-494c-a286-70452a235cf1.png",
"video": "https://static.sandbase.ai/examples/874ae93a-9288-40dc-b214-6c73426b2d22/input/c93e1785-2391-4b49-805a-bd2bfe345c93.mp4"
}Swap the person in a reference video for the character in image. Motion, camera, and scene come from the video; the new character's look comes from the picture, relit to fit the scene.
| Field | Type | Default | Notes |
|---|---|---|---|
image | image URL, required | — | Character image. JPEG, PNG, or WebP URL. |
video | video URL, required | — | Reference video that supplies the motion. |
resolution | 480p / 580p / 720p | 720p | Sets the rate. |
use_turbo | boolean | false | Faster generation at some quality cost. |
seed | integer 0–2147483647 | random | Fix it to compare prompt changes. |
Billing follows the upstream unit: output seconds counted at 16 frames per second, so a 30fps output bills about 1.9× its wall-clock length. Rates per counted second: $0.04 at 480p, $0.06 at 580p, $0.08 at 720p. The quote before submission assumes a 5-second, 30fps result; the final charge uses the measured output.
| Output | 480p | 580p | 720p |
|---|---|---|---|
| 5s at 30fps | $0.375 | $0.5625 | $0.75 |
| 10s at 30fps | $0.75 | $1.125 | $1.50 |
| 10s at 16fps | $0.40 | $0.60 | $0.80 |
Failed runs are not charged.
Other Wan 2.2 endpoints: alibaba/wan/2.2/animate/move, alibaba/wan/2.2/speech-to-video.
Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "alibaba/wan/2.2/animate/replace",
"image": "https://static.sandbase.ai/examples/alibaba/wan/2.2/animate/replace/input_image_0.png",
"video": "https://static.sandbase.ai/examples/alibaba/wan/2.2/animate/replace/input_video_1.mp4",
"use_turbo": false,
"resolution": "720p"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
seedintegerRandom seed for reproducibility.
Minimum: 0
Maximum: 2147483647
imagestringrequiredInput image URL (face / character).
videostringrequiredReference video.
use_turbobooleanFaster generation with quality enhancement.
Default: false
resolutionstringOutput resolution.
Default: "720p"
Possible values: "480p", "580p", "720p"
{
"model": "alibaba/wan/2.2/animate/replace",
"image": "https://static.sandbase.ai/examples/alibaba/wan/2.2/animate/replace/input_image_0.png",
"video": "https://static.sandbase.ai/examples/alibaba/wan/2.2/animate/replace/input_video_1.mp4",
"use_turbo": false,
"resolution": "720p"
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"poster": "https://static.sandbase.ai/examples/posters/4d5a028d71443e685f77.jpg",
"source": "Alibaba Model Studio schema mirror",
"source_url": "https://www.alibabacloud.com/help/en/model-studio/",
"url": "https://static.sandbase.ai/examples/874ae93a-9288-40dc-b214-6c73426b2d22/output/a33829fd-db96-4b56-9675-74ed689de1e0.mp4"
}
]