mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-11-11 03:24:30 +00:00
fix: skip metadata alpha for LoRAs with baked_scale (#2202)
This commit is contained in:
1 parent
95ff762308
commit
50a64f075e
1 file changed
+2
-1
@@ -69,7 +69,8 @@ struct LoraModel : public GGMLRunner {
|
|||||||
metadata_alpha = -1.f;
|
metadata_alpha = -1.f;
|
||||||
const auto metadata = model_manager->loader().file_metadata(source_file);
|
const auto metadata = model_manager->loader().file_metadata(source_file);
|
||||||
const auto alpha = metadata.find("alpha");
|
const auto alpha = metadata.find("alpha");
|
||||||
if (alpha != metadata.end()) {
|
// Converters that write "baked_scale" have already folded alpha / rank into lora_up.
|
||||||
|
if (alpha != metadata.end() && metadata.find("baked_scale") == metadata.end()) {
|
||||||
try {
|
try {
|
||||||
size_t parsed = 0;
|
size_t parsed = 0;
|
||||||
metadata_alpha = std::stof(alpha->second, &parsed);
|
metadata_alpha = std::stof(alpha->second, &parsed);
|
||||||
|
|||||||
Reference in new issue
Block a user