refactor: remove is_xl guard wrapper in get_sd_version (#1430)

This commit is contained in:
leejet 2026-04-17 01:53:58 +08:00 committed by GitHub
parent 84fc5446d2
commit a564fdf642
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1022,7 +1022,6 @@ SDVersion ModelLoader::get_sd_version() {
bool has_attn_1024 = false; bool has_attn_1024 = false;
for (auto& [name, tensor_storage] : tensor_storage_map) { for (auto& [name, tensor_storage] : tensor_storage_map) {
if (!(is_xl)) {
if (tensor_storage.name.find("model.diffusion_model.double_blocks.") != std::string::npos) { if (tensor_storage.name.find("model.diffusion_model.double_blocks.") != std::string::npos) {
is_flux = true; is_flux = true;
} }
@ -1080,7 +1079,6 @@ SDVersion ModelLoader::get_sd_version() {
if (tensor_storage.name.find("model.diffusion_model.input_blocks.8.0.time_mixer.mix_factor") != std::string::npos) { if (tensor_storage.name.find("model.diffusion_model.input_blocks.8.0.time_mixer.mix_factor") != std::string::npos) {
return VERSION_SVD; return VERSION_SVD;
} }
}
if (tensor_storage.name.find("model.diffusion_model.middle_block.1.") != std::string::npos || if (tensor_storage.name.find("model.diffusion_model.middle_block.1.") != std::string::npos ||
tensor_storage.name.find("unet.mid_block.resnets.1.") != std::string::npos) { tensor_storage.name.find("unet.mid_block.resnets.1.") != std::string::npos) {
has_middle_block_1 = true; has_middle_block_1 = true;