[WIP][diffusion] new model: support Wan Animate with Data preprocessing #16113
+6,177
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Supporting Wan Animate (https://huggingface.co/Wan-AI/Wan2.2-Animate-14B-Diffusers)
See issue #13867
Based on PR #15419
Modifications
This PR introduces a customized orchestration pipeline for the Wan Animate model. By implementing a Segment Loop mechanism, it overcomes VRAM limitations for long video generation. Additionally, it integrates a Data Preprocessing stage that supports direct extraction of pose and face features from raw videos, significantly lowering the barrier to entry for end-users.
Pipeline Design
WanAnimatePipeline:SegmentLoopStage
Data Preprocessing Stage
We provide a Data Preprocessing Stage, if users provide the onnx model path of the preprocess model, we can directly process the original video passed in by the user instead of the user passing in the preprocessed pose video and face video.
With
preprocess_model_path:sglang generate --model-path Wan-AI/Wan2.2-Animate-14B-Diffusers \ --prompt='People in the video are doing actions.' --image-path [ref image path] --video-path [video path] --preprocess-model-path [process model path] --width 1280 --height 720 --save-outputWithout
preprocess_model_path:TODO
Accuracy Tests
Replicate.com wan animate animation:
replicate-prediction-h3jf38znwnrma0csgty9ejwmbg.mp4
Our results:
People_in_the_video_are_doing_actions._20251229-141238_91e44799.mp4
Checklist