Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fe35689

Browse files
author
Stéphane du Hamel
committedDec 26, 2024·
more specific sdxl fingerprint
1 parent 17b4fc5 commit fe35689

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed
 

‎model.cpp

+19-4
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,10 @@ SDVersion ModelLoader::get_sd_version() {
14611461
TensorStorage token_embedding_weight, input_block_weight;
14621462
bool input_block_checked = false;
14631463

1464-
bool is_xl = false;
1464+
bool has_multiple_encoders = false;
1465+
bool is_unet = false;
1466+
1467+
bool is_xl = false;
14651468
bool is_flux = false;
14661469

14671470
#define found_family (is_xl || is_flux)
@@ -1476,10 +1479,22 @@ SDVersion ModelLoader::get_sd_version() {
14761479
if (tensor_storage.name.find("model.diffusion_model.joint_blocks.") != std::string::npos) {
14771480
return VERSION_SD3;
14781481
}
1482+
if (tensor_storage.name.find("model.diffusion_model.input_blocks.") != std::string::npos) {
1483+
is_unet = true;
1484+
if(has_multiple_encoders){
1485+
is_xl = true;
1486+
if (input_block_checked) {
1487+
break;
1488+
}
1489+
}
1490+
}
14791491
if (tensor_storage.name.find("conditioner.embedders.1") != std::string::npos || tensor_storage.name.find("cond_stage_model.1") != std::string::npos) {
1480-
is_xl = true;
1481-
if (input_block_checked) {
1482-
break;
1492+
has_multiple_encoders = true;
1493+
if(is_unet){
1494+
is_xl = true;
1495+
if (input_block_checked) {
1496+
break;
1497+
}
14831498
}
14841499
}
14851500
if (tensor_storage.name.find("model.diffusion_model.input_blocks.8.0.time_mixer.mix_factor") != std::string::npos) {

0 commit comments

Comments
 (0)
Please sign in to comment.