This commit is contained in:
Concedo
2026-05-28 22:45:24 +08:00
parent 2c6184054d
commit 13663730a9
4 changed files with 57 additions and 22 deletions
+23 -15
View File
@@ -277,13 +277,14 @@ public:
}
max_vram = sd::ggml_graph_cut::resolve_max_vram_gib(max_vram, backend_for(SDBackendModule::DIFFUSION));
std::string clip_vision_fixed = SAFE_STR(sd_ctx_params->clip_vision_path);
std::string clipg_path_fixed = SAFE_STR(sd_ctx_params->clip_g_path);
std::string clipl_path_fixed = SAFE_STR(sd_ctx_params->clip_l_path);
std::string llm_path_fixed = SAFE_STR(sd_ctx_params->llm_path);
std::string clip_vision_fixed = SAFE_STR(sd_ctx_params->clip_vision_path);
std::string clipg_path_fixed = SAFE_STR(sd_ctx_params->clip_g_path);
std::string clipl_path_fixed = SAFE_STR(sd_ctx_params->clip_l_path);
std::string llm_path_fixed = SAFE_STR(sd_ctx_params->llm_path);
std::string llm_vision_path_fixed = SAFE_STR(sd_ctx_params->llm_vision_path);
std::string t5_path_fixed = SAFE_STR(sd_ctx_params->t5xxl_path);
std::string taesd_path_fixed = SAFE_STR(sd_ctx_params->taesd_path);
std::string t5_path_fixed = SAFE_STR(sd_ctx_params->t5xxl_path);
std::string taesd_path_fixed = SAFE_STR(sd_ctx_params->taesd_path);
std::string embed_connector_fixed = SAFE_STR(sd_ctx_params->embeddings_connectors_path);
ModelLoader model_loader;
@@ -353,7 +354,8 @@ public:
bool is_ernie = sd_version_is_ernie_image(tempver);
bool is_longcat = sd_version_is_longcat(tempver);
bool is_lens = sd_version_is_lens(tempver);
bool conditioner_is_llm = (is_qwenimg || iszimg || isflux2 || is_ovis || is_anima || is_ernie || is_longcat || is_lens);
bool is_ltx = sd_version_is_ltxav(tempver);
bool conditioner_is_llm = (is_qwenimg || iszimg || isflux2 || is_ovis || is_anima || is_ernie || is_longcat || is_lens || is_ltx);
//kcpp qol fallback: if a llm was loaded as t5 by mistake
if(conditioner_is_llm && t5_path_fixed!="")
@@ -366,7 +368,7 @@ public:
else if(clipl_path_fixed!="" && clipg_path_fixed=="")
{
//very tricky case. see if we can tell if clipl is an mmproj, if so move to right place
if(toLowerCase(clipl_path_fixed).find("mmproj") != std::string::npos)
if(toLowerCase(clipl_path_fixed).find("mmproj") != std::string::npos || is_ltx)
{
clipg_path_fixed = clipl_path_fixed;
clipl_path_fixed = t5_path_fixed;
@@ -409,6 +411,11 @@ public:
llm_vision_path_fixed = clipg_path_fixed;
clipg_path_fixed = "";
}
else if(is_ltx)
{
embed_connector_fixed = clipg_path_fixed;
clipg_path_fixed = "";
}
}
//settle possible inversions for mmproj
@@ -476,13 +483,14 @@ public:
sd_ctx_params->photo_maker_path = "";
}
sd_ctx_params->clip_g_path = clipg_path_fixed.c_str();
sd_ctx_params->clip_l_path = clipl_path_fixed.c_str();
sd_ctx_params->clip_vision_path = clip_vision_fixed.c_str();
sd_ctx_params->llm_path = llm_path_fixed.c_str();
sd_ctx_params->llm_vision_path = llm_vision_path_fixed.c_str();
sd_ctx_params->t5xxl_path = t5_path_fixed.c_str();
sd_ctx_params->taesd_path = taesd_path_fixed.c_str();
sd_ctx_params->clip_g_path = clipg_path_fixed.c_str();
sd_ctx_params->clip_l_path = clipl_path_fixed.c_str();
sd_ctx_params->clip_vision_path = clip_vision_fixed.c_str();
sd_ctx_params->llm_path = llm_path_fixed.c_str();
sd_ctx_params->llm_vision_path = llm_vision_path_fixed.c_str();
sd_ctx_params->t5xxl_path = t5_path_fixed.c_str();
sd_ctx_params->taesd_path = taesd_path_fixed.c_str();
sd_ctx_params->embeddings_connectors_path = embed_connector_fixed.c_str();
//debug print
// printf("\n\nclip_g: %s\nclip_l: %s\nclip_vision: %s\nllm: %s\nllm_vision: %s\nt5xxl: %s\ntaesd: %s\n",
// sd_ctx_params->clip_g_path, sd_ctx_params->clip_l_path, sd_ctx_params->clip_vision_path,