From b75f5604a7e4534899c720ef8db5e15042b2b9f9 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 13 Mar 2024 10:21:16 -0700 Subject: [PATCH] v0.2.1 (#294) * fix typo (#79) * Faster and simplified install * Print correct profile when engine is loaded * Use scripts callbacks * increase max resolution * adding native LoRA support, avoiding model.py import error and some refactoring * more refactoring and added typing * Enable torch fallback * update inastall * change default XL engine * cc independent lora * Update Instrucitons * Fix for #225 Install.py silently blocked by blocking call of nvidia-cudnn-cu11 uninstall due to interactive python shell opening (#226) * v0.2.0 (#217) * fix typo (#79) * Print correct profile when engine is loaded * Use scripts callbacks * increase max resolution * adding native LoRA support, avoiding model.py import error and some refactoring * more refactoring and added typing * Enable torch fallback * update inastall * change default XL engine * cc independent lora * Update Instrucitons --------- Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> * Fix subprocess blocking issue when installing --------- Co-authored-by: Luca Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> * Resolve AttributeError on generation without Unet (#224) * v0.2.0 (#217) * fix typo (#79) * Print correct profile when engine is loaded * Use scripts callbacks * increase max resolution * adding native LoRA support, avoiding model.py import error and some refactoring * more refactoring and added typing * Enable torch fallback * update inastall * change default XL engine * cc independent lora * Update Instrucitons --------- Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> * Resolve AttributeError on generation without Unet --------- Co-authored-by: Luca Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> * Fixes crashes cause by lora checkpoint configs missing sd version (#251) During the initial Lora loading process, if a config for a specified **.safetensor** file does not contain the property **"sd version"**, the plugin crashes and does not show the trt tab. fixes the issue by inferencing the model version as unknown * Fix AttributeError when accessing profile_idx of NoneType (#259) * fix #157 --------- Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> Co-authored-by: Andrew Vuong Co-authored-by: Aether <59086566+AetherMagee@users.noreply.github.com> Co-authored-by: ZN <72399198+Zn10plays@users.noreply.github.com> Co-authored-by: Yuki Shindo --- install.py | 5 ++++- scripts/trt.py | 2 +- ui_trt.py | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/install.py b/install.py index b02753d..105ad56 100644 --- a/install.py +++ b/install.py @@ -1,11 +1,14 @@ import launch import sys -from importlib_metadata import version python = sys.executable def install(): + if not launch.is_installed("importlib_metadata"): + launch.run_pip("install importlib_metadata", "importlib_metadata", live=True) + from importlib_metadata import version + if launch.is_installed("tensorrt"): if not version("tensorrt") == "9.0.1.post11.dev4": launch.run( diff --git a/scripts/trt.py b/scripts/trt.py index b9f16aa..1c16b74 100644 --- a/scripts/trt.py +++ b/scripts/trt.py @@ -299,7 +299,7 @@ def process_batch(self, p, *args, **kwargs): if self.torch_unet: return super().process_batch(p, *args, **kwargs) - if self.idx != sd_unet.current_unet.profile_idx: + if sd_unet.current_unet is not None and self.idx != sd_unet.current_unet.profile_idx: sd_unet.current_unet.profile_idx = self.idx sd_unet.current_unet.switch_engine() diff --git a/ui_trt.py b/ui_trt.py index 4f19847..6075084 100644 --- a/ui_trt.py +++ b/ui_trt.py @@ -268,7 +268,10 @@ def get_lora_checkpoints(): if os.path.exists(config_file): with open(config_file, "r") as f: config = json.load(f) - version = SDVersion.from_str(config["sd version"]) + try: + version = SDVersion.from_str(config["sd version"]) + except: + version = SDVersion.Unknown else: version = SDVersion.Unknown