diff --git a/extensions-builtin/Lora/lora.py b/extensions-builtin/Lora/lora.py index 1308c48ba601ba7840f0dc4b0a2e029ca764d812..fa57d466e037ab8849948efb28a55b5074139db2 100644 --- a/extensions-builtin/Lora/lora.py +++ b/extensions-builtin/Lora/lora.py @@ -3,7 +3,7 @@ import re import torch from typing import Union -from modules import shared, devices, sd_models, errors, scripts +from modules import shared, devices, sd_models, errors, scripts, sd_hijack metadata_tags_order = {"ss_sd_model_name": 1, "ss_resolution": 2, "ss_clip_skip": 3, "ss_num_train_images": 10, "ss_tag_frequency": 20} @@ -211,6 +211,8 @@ def load_loras(names, multipliers=None): loras_on_disk = [available_lora_aliases.get(name, None) for name in names] + failed_to_load_loras = [] + for i, name in enumerate(names): lora = already_loaded.get(name, None) @@ -224,12 +226,16 @@ def load_loras(names, multipliers=None): continue if lora is None: + failed_to_load_loras.append(name) print(f"Couldn't find Lora with name {name}") continue lora.multiplier = multipliers[i] if multipliers else 1.0 loaded_loras.append(lora) + if len(failed_to_load_loras) > 0: + sd_hijack.model_hijack.comments.append("Failed to find Loras: " + ", ".join(failed_to_load_loras)) + def lora_calc_updown(lora, module, target): with torch.no_grad(): diff --git a/modules/processing.py b/modules/processing.py index 2b8dd361d7eaee3d39ac8c3b4b053451da3def78..7ee6da28b9d86cc4bdf1c87f459cceaad5806ec0 100644 --- a/modules/processing.py +++ b/modules/processing.py @@ -808,7 +808,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed: images_list=output_images, seed=p.all_seeds[0], info=infotext(), - comments="".join(f"\n\n{comment}" for comment in comments), + comments="".join(f"{comment}\n" for comment in comments), subseed=p.all_subseeds[0], index_of_first_image=index_of_first_image, infotexts=infotexts,