[Modular] refactor Wan: modular pipelines by task etc #13063
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.
This PR:
1. Split the Wan modular pipeline into separate pipelines per task:
WanModularPipeline->WanBlocks(wan2.1_T2V)WanImage2VideoModularPipeline->WanImage2VideoBlocks(wan2.1+I2V + FLF2V)Wan22ModularPipeline->Wan22Blocks(wan2.2_T2V)Wan22Image2VideoModularPipeline->Wan22Image2VideoBlocks(wan2.2_I2V)Unlike image models where a single checkpoint can support multiple workflows, video models are usually trained for specific tasks. So there's no need to use
AutoPipelineBlockssince a checkpoint cannot be reused across different workflows2. Refactored the I2V and FLF2V pipelines so that their denoise block both accept
image_condition_latentsinput:image_condition_latentsafter encoding and maskingfirst_frame_latentsfor I2V andfirst_last_frame_latentsfor FLF2V)3. Refactored
MODULAR_PIPELINE_MAPPINGso that we can map one standard pipeline to more than one modular pipeline based on the config. e.g. you can map
WanPipelnetoWanModularPipelinevsWan22ModularPipelinebased onboundary_ratio.Previously, the mapping was a simplemodel_name → pipeline_classdict so it has to be 1:1 map.test script for wan