File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -881,14 +881,19 @@ class StableDiffusionGGML {
881
881
for (auto & kv : lora_state) {
882
882
const std::string& lora_name = kv.first ;
883
883
float multiplier = kv.second ;
884
-
885
- if (curr_lora_state.find (lora_name) != curr_lora_state.end ()) {
886
- float curr_multiplier = curr_lora_state[lora_name];
887
- multiplier -= curr_multiplier;
888
- }
889
- if (multiplier != 0 .f ) {
890
- lora_state_diff[lora_name] = multiplier;
891
- }
884
+ lora_state_diff[lora_name] += multiplier;
885
+ }
886
+ for (auto & kv : curr_lora_state) {
887
+ const std::string& lora_name = kv.first ;
888
+ float curr_multiplier = kv.second ;
889
+ lora_state_diff[lora_name] -= curr_multiplier;
890
+ }
891
+
892
+ size_t rm = lora_state_diff.size () - lora_state.size ();
893
+ if (rm != 0 ) {
894
+ LOG_INFO (" Attempting to apply %lu LoRAs (removing %lu applied LoRAs)" , lora_state.size (), rm);
895
+ } else {
896
+ LOG_INFO (" Attempting to apply %lu LoRAs" , lora_state.size ());
892
897
}
893
898
894
899
for (auto & kv : lora_state_diff) {
You can’t perform that action at this time.
0 commit comments