From ebc1db2e9f02aa3219d62a01bd5f2121faec0556 Mon Sep 17 00:00:00 2001 From: bghira Date: Tue, 22 Aug 2023 21:27:58 -0700 Subject: [PATCH] Allow override of using safetensors --- discord_tron_client/classes/app_config.py | 4 +++- discord_tron_client/classes/image_manipulation/pipeline.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/discord_tron_client/classes/app_config.py b/discord_tron_client/classes/app_config.py index 9e218ce5..8e079e2f 100644 --- a/discord_tron_client/classes/app_config.py +++ b/discord_tron_client/classes/app_config.py @@ -295,4 +295,6 @@ def enable_offload(self): def enable_sequential_offload(self): return self.get_config_value('enable_sequential_offload', False) def maximum_batch_size(self): - return max(self.get_config_value('maximum_batch_size', 4), 1) \ No newline at end of file + return max(self.get_config_value('maximum_batch_size', 4), 1) + def use_safetensors(self): + return self.get_config_value('use_safetensors', True) \ No newline at end of file diff --git a/discord_tron_client/classes/image_manipulation/pipeline.py b/discord_tron_client/classes/image_manipulation/pipeline.py index 176ec935..f9537c58 100644 --- a/discord_tron_client/classes/image_manipulation/pipeline.py +++ b/discord_tron_client/classes/image_manipulation/pipeline.py @@ -108,6 +108,7 @@ def _prepare_pipe( prompt_variation=variation, promptless_variation=promptless_variation, upscaler=upscaler, + use_safetensors=self.config.use_safetensors(), ) logging.info("Copied pipe to the local context") return pipe @@ -523,6 +524,8 @@ def _controlnet_pipeline( # prompt_embed, negative_embed = controlnet_prompt_manager.process_long_prompt( # positive_prompt=prompt, negative_prompt=negative_prompt # ) + pipe.vae.disable_tiling() + pipe.vae.disable_slicing() new_image = pipe( # prompt_embeds=prompt_embed, # negative_prompt_embeds=negative_embed,