refactor: use a distinct version id for Chroma (#2237)

This commit is contained in:
Wagner Bruna authored and GitHub committed 2026-10-28 22:02:18 +08:00
1 parent 687915518e
commit 8cbe905fdd
5 files changed
+29 -11

No files matched your search

+7
View File
@@ -468,6 +468,7 @@ SDVersion ModelLoader::get_sd_version() const {
bool has_output_block_311 = false;
bool has_output_block_71 = false;
bool has_attn_1024 = false;
bool has_distilled_guidance = false;
for (auto& [name, tensor_storage] : tensor_storage_map) {
if (tensor_storage.name.find("model.diffusion_model.double_blocks.") != std::string::npos ||
@@ -487,6 +488,9 @@ SDVersion ModelLoader::get_sd_version() const {
if (tensor_storage.name.find("model.diffusion_model.nerf_final_layer_conv.") != std::string::npos) {
return VERSION_CHROMA_RADIANCE;
}
if (tensor_storage.name.find("distilled_guidance_layer.in_proj.weight") != std::string::npos) {
has_distilled_guidance = true;
}
if (tensor_storage.name.find("model.diffusion_model.joint_blocks.") != std::string::npos) {
return VERSION_SD3;
}
@@ -676,6 +680,9 @@ SDVersion ModelLoader::get_sd_version() const {
}
if (is_flux && !is_flux2) {
if (has_distilled_guidance) {
return VERSION_CHROMA;
}
if (context_ebedding_weight.ne[0] == 3584) {
return VERSION_LONGCAT;
} else {