From 097780be266c527de0ff901b463da776225500a8 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 11 Dec 2023 22:28:19 +0530 Subject: [PATCH 1/2] Setting to enable/disable VAE tiling --- ui/easydiffusion/tasks/render_images.py | 5 +++++ ui/easydiffusion/types.py | 1 + ui/index.html | 7 +++++++ ui/media/js/main.js | 2 ++ 4 files changed, 15 insertions(+) diff --git a/ui/easydiffusion/tasks/render_images.py b/ui/easydiffusion/tasks/render_images.py index 9260349f..50c76c2e 100644 --- a/ui/easydiffusion/tasks/render_images.py +++ b/ui/easydiffusion/tasks/render_images.py @@ -278,6 +278,11 @@ def generate_images_internal( setattr(pipe.unet, "_allocate_trt_buffers_backup", pipe.unet._allocate_trt_buffers) delattr(pipe.unet, "_allocate_trt_buffers") + if task_data.enable_vae_tiling: + pipe.enable_vae_tiling() + else: + pipe.disable_vae_tiling() + images = generate_images(context, callback=callback, **req.dict()) user_stopped = False except UserInitiatedStop: diff --git a/ui/easydiffusion/types.py b/ui/easydiffusion/types.py index ec331c29..f16e9aa3 100644 --- a/ui/easydiffusion/types.py +++ b/ui/easydiffusion/types.py @@ -84,6 +84,7 @@ class RenderTaskData(TaskData): filters: List[str] = [] filter_params: Dict[str, Dict[str, Any]] = {} control_filter_to_apply: Union[str, List[str]] = None + enable_vae_tiling: bool = True show_only_filtered_image: bool = False block_nsfw: bool = False diff --git a/ui/index.html b/ui/index.html index fcbcfa73..3aa213d2 100644 --- a/ui/index.html +++ b/ui/index.html @@ -387,6 +387,13 @@ + + + + + + +