From 15d0f82760e2d44d9bec904b277c4a7ad1f6b2ed Mon Sep 17 00:00:00 2001 From: leejet Date: Sat, 13 Dec 2025 14:27:47 +0800 Subject: [PATCH] feat(server): do not parse lora fromt client-side prompts (#1083) --- 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 558817e..0ab5c08 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 90cf484..f1ba0cd 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;