
Wan2.2-Animate-2 is a novel end-to-end character animation framework
Follow the steps below to download and run the NVIDIA NIM inference microservice for this model on your infrastructure of choice.
Pull and run the NIM with the command below.
# Create the cache directory on the host machine.
export LOCAL_NIM_CACHE=~/.cache/nim
mkdir -p "$LOCAL_NIM_CACHE"
chmod 777 $LOCAL_NIM_CACHE
docker run -it --rm --name=nim-server \
--runtime=nvidia --gpus all \
-p 8000:8000 \
-v "$LOCAL_NIM_CACHE:/opt/nim/.cache/" \
nvcr.io/nim/wan-ai/wan2.2-animate-2-14b:latest
When you run the preceding command, the container downloads the model, initializes a NIM inference pipeline, and performs a pipeline warm up.
A pipeline warm up typically requires up to three minutes. The warm up is complete when the container logs show Pipeline warmup: start/done.
invoke_url="http://localhost:8000/v1/infer"
input_video_path="input_video.mp4"
input_image_path="input_image.jpg"
output_video_path="result.mp4"
curl https://assets.ngc.nvidia.com/products/api-catalog/wan2-2-animate-2-14-b/reference.jpg > $input_image_path
input_image_b64=$(base64 -w 0 $input_image_path)
curl https://assets.ngc.nvidia.com/products/api-catalog/wan2-2-animate-2-14-b/driving_video.mp4 > $input_video_path
input_video_b64=$(base64 -w 0 $input_video_path)
echo '{
"prompt": "A person is dancing energetically",
"image": "data:image/jpeg;base64,'${input_image_b64}'",
"video": "data:video/mp4;base64,'${input_video_b64}'",
"seed": 0
}' > payload.json
response=$(curl -X POST $invoke_url \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d @payload.json )
response_body=$(echo "$response" | awk '/{/,EOF-1')
echo $response_body | jq .artifacts[0].base64 | tr -d '"' | base64 --decode > $output_video_path
For more details on getting started with this NIM including configuring using parameters, visit the Visual GenAI NIM docs.