From 06c2b15e6d844915cdbc40fbed9fe47e60356fc4 Mon Sep 17 00:00:00 2001 From: leejet Date: Sun, 30 Nov 2025 12:17:59 +0800 Subject: [PATCH] fix: avoid crash when the lora file is not found using immediately mode --- stable-diffusion.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stable-diffusion.cpp b/stable-diffusion.cpp index ef798c2d8..074290d84 100644 --- a/stable-diffusion.cpp +++ b/stable-diffusion.cpp @@ -991,6 +991,9 @@ class StableDiffusionGGML { int64_t t0 = ggml_time_ms(); auto lora = load_lora_model_from_file(kv.first, kv.second, backend); + if (!lora || lora->lora_tensors.empty()) { + continue; + } lora->apply(tensors, version, n_threads); lora->free_params_buffer();