Skip to content

Commit 70a9d58

Browse files
committed
fixed sefi loading
1 parent 062a2d0 commit 70a9d58

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

otherarch/sdcpp/src/stable-diffusion.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,10 @@ class StableDiffusionGGML {
666666

667667
// begin kcpp replacements
668668
SDVersion tempver = model_loader.get_sd_version();
669+
bool fallback_swapped = false;
669670

670671
// kcpp fallback to separate diffusion model passed as model
671-
if (tempver == VERSION_COUNT &&
672-
strlen(SAFE_STR(sd_ctx_params->model_path)) > 0 &&
672+
if (strlen(SAFE_STR(sd_ctx_params->model_path)) > 0 &&
673673
strlen(SAFE_STR(sd_ctx_params->diffusion_model_path)) == 0 &&
674674
(t5_path_fixed!=""||clipl_path_fixed!=""))
675675
{
@@ -680,11 +680,12 @@ class StableDiffusionGGML {
680680
if (!model_loader.init_from_file(sd_ctx_params->model_path, "model.diffusion_model.")) {
681681
LOG_WARN("loading diffusion model from '%s' failed", sd_ctx_params->model_path);
682682
}
683+
fallback_swapped = true;
683684
tempver = model_loader.get_sd_version();
684685
}
685686
}
686687

687-
if (tempver == VERSION_ANIMA &&
688+
if (tempver == VERSION_ANIMA && !fallback_swapped &&
688689
strlen(SAFE_STR(sd_ctx_params->model_path)) > 0 &&
689690
strlen(SAFE_STR(sd_ctx_params->diffusion_model_path)) == 0 &&
690691
!model_loader.has_diffusion_model_tensors()

0 commit comments

Comments
 (0)