From 85aad4ad8b346e825aa07fba3404165c8164756f Mon Sep 17 00:00:00 2001 From: leejet Date: Thu, 4 Dec 2025 22:41:28 +0800 Subject: [PATCH] optimize lora log --- stable-diffusion.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stable-diffusion.cpp b/stable-diffusion.cpp index 8ac6b73ef..831beb9c8 100644 --- a/stable-diffusion.cpp +++ b/stable-diffusion.cpp @@ -998,6 +998,12 @@ class StableDiffusionGGML { lora_state_diff[lora_name] -= curr_multiplier; } + if (lora_state_diff.empty()) { + return; + } + + LOG_INFO("apply lora immediately"); + size_t rm = lora_state_diff.size() - lora_state.size(); if (rm != 0) { LOG_INFO("attempting to apply %lu LoRAs (removing %lu applied LoRAs)", lora_state.size(), rm); @@ -1027,6 +1033,10 @@ class StableDiffusionGGML { cond_stage_lora_models.clear(); diffusion_lora_models.clear(); first_stage_lora_models.clear(); + if (lora_state.empty()) { + return; + } + LOG_INFO("apply lora at runtime"); if (cond_stage_model) { std::vector> lora_models; auto lora_state_diff = lora_state; @@ -1161,10 +1171,8 @@ class StableDiffusionGGML { } int64_t t0 = ggml_time_ms(); if (apply_lora_immediately) { - LOG_INFO("apply lora immediately"); apply_loras_immediately(lora_f2m); } else { - LOG_INFO("apply at runtime"); apply_loras_at_runtime(lora_f2m); } int64_t t1 = ggml_time_ms();