feat: add Wan2.2 S2V (audio+img-to-video) support (#1925)

Co-authored-by: leejet <leejet714@gmail.com>
This commit is contained in:
George
2026-09-13 23:33:50 +08:00
committed by GitHub
co-authored by leejet
parent 4a7da26b73
commit 0bd72f075a
32 changed files with 1533 additions and 57 deletions
+9
View File
@@ -435,6 +435,7 @@ SDVersion ModelLoader::get_sd_version() const {
bool is_flux2 = false;
bool has_single_block_47 = false;
bool is_wan = false;
bool is_s2v = false;
int64_t patch_embedding_channels = 0;
bool has_img_emb = false;
bool has_middle_block_1 = false;
@@ -524,6 +525,11 @@ SDVersion ModelLoader::get_sd_version() const {
if (tensor_storage.name.find("model.diffusion_model.blocks.0.cross_attn.norm_k.weight") != std::string::npos) {
is_wan = true;
}
if (tensor_storage.name.find("casual_audio_encoder.weights") != std::string::npos ||
tensor_storage.name.find("audio_injector.injector.0.q.weight") != std::string::npos) {
// S2V and T2V-14B share patch_embedding shapes.
is_s2v = true;
}
if (tensor_storage.name.find("model.diffusion_model.patch_embedder.weight") != std::string::npos) {
return VERSION_LINGBOT_VIDEO;
}
@@ -587,6 +593,9 @@ SDVersion ModelLoader::get_sd_version() const {
}
if (is_wan) {
LOG_VERBOSE("patch_embedding_channels %d", patch_embedding_channels);
if (is_s2v) {
return VERSION_WAN2_2_S2V;
}
if (patch_embedding_channels == 184320 && !has_img_emb) {
return VERSION_WAN2_2_I2V;
}