mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-01-02 18:53:36 +00:00
feat(server): do not parse lora fromt client-side prompts (#1083)
This commit is contained in:
parent
6888fcb581
commit
15d0f82760
@ -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"(<lora:([^:>]+):([^>]+)>)");
|
||||
static const std::vector<std::string> valid_ext = {".pt", ".safetensors", ".gguf"};
|
||||
std::smatch m;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user