From e05b1ea7efd82628e9a4d79ecfe10ecc504f3611 Mon Sep 17 00:00:00 2001 From: leejet Date: Sat, 13 Dec 2025 14:26:45 +0800 Subject: [PATCH] feat(server): do not parse lora fromt client-side prompts --- examples/common/common.hpp | 3 +++ examples/server/main.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/common/common.hpp b/examples/common/common.hpp index 558817eea..0ab5c08a4 100644 --- a/examples/common/common.hpp +++ b/examples/common/common.hpp @@ -1349,6 +1349,9 @@ struct SDGenerationParams { } void extract_and_remove_lora(const std::string& lora_model_dir) { + if (lora_model_dir.empty()) { + return; + } static const std::regex re(R"(]+):([^>]+)>)"); static const std::vector valid_ext = {".pt", ".safetensors", ".gguf"}; std::smatch m; diff --git a/examples/server/main.cpp b/examples/server/main.cpp index 90cf484b9..f1ba0cd14 100644 --- a/examples/server/main.cpp +++ b/examples/server/main.cpp @@ -425,7 +425,7 @@ int main(int argc, const char** argv) { return; } - if (!gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) { + if (!gen_params.process_and_check(IMG_GEN, "")) { res.status = 400; res.set_content(R"({"error":"invalid params"})", "application/json"); return; @@ -605,7 +605,7 @@ int main(int argc, const char** argv) { return; } - if (!gen_params.process_and_check(IMG_GEN, ctx_params.lora_model_dir)) { + if (!gen_params.process_and_check(IMG_GEN, "")) { res.status = 400; res.set_content(R"({"error":"invalid params"})", "application/json"); return;