Skip to content

Commit

Permalink
fix extract_and_remove_lora
Browse files Browse the repository at this point in the history
  • Loading branch information
leejet committed Nov 21, 2023
1 parent f8e5eaa commit 8242631
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stable-diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ std::pair<std::unordered_map<std::string, float>, std::string> extract_and_remov
std::string filename = matches[1].str();
float multiplier = std::stof(matches[2].str());

text = std::regex_replace(text, re, "", std::regex_constants::format_first_only);

if (multiplier == 0.f) {
continue;
}
Expand All @@ -339,7 +341,6 @@ std::pair<std::unordered_map<std::string, float>, std::string> extract_and_remov
filename2multiplier[filename] += multiplier;
}

text = std::regex_replace(text, re, "", std::regex_constants::format_first_only);
}

return std::make_pair(filename2multiplier, text);
Expand Down

0 comments on commit 8242631

Please sign in to comment.