Skip to content

Commit

Permalink
more specific sdxl fingerprint
Browse files Browse the repository at this point in the history
  • Loading branch information
Stéphane du Hamel committed Dec 26, 2024
1 parent 17b4fc5 commit fe35689
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,10 @@ SDVersion ModelLoader::get_sd_version() {
TensorStorage token_embedding_weight, input_block_weight;
bool input_block_checked = false;

bool is_xl = false;
bool has_multiple_encoders = false;
bool is_unet = false;

bool is_xl = false;
bool is_flux = false;

#define found_family (is_xl || is_flux)
Expand All @@ -1476,10 +1479,22 @@ SDVersion ModelLoader::get_sd_version() {
if (tensor_storage.name.find("model.diffusion_model.joint_blocks.") != std::string::npos) {
return VERSION_SD3;
}
if (tensor_storage.name.find("model.diffusion_model.input_blocks.") != std::string::npos) {
is_unet = true;
if(has_multiple_encoders){
is_xl = true;
if (input_block_checked) {
break;
}
}
}
if (tensor_storage.name.find("conditioner.embedders.1") != std::string::npos || tensor_storage.name.find("cond_stage_model.1") != std::string::npos) {
is_xl = true;
if (input_block_checked) {
break;
has_multiple_encoders = true;
if(is_unet){
is_xl = true;
if (input_block_checked) {
break;
}
}
}
if (tensor_storage.name.find("model.diffusion_model.input_blocks.8.0.time_mixer.mix_factor") != std::string::npos) {
Expand Down

0 comments on commit fe35689

Please sign in to comment.