From ac0961d7d4dca73a8a90f06e91f4b283214f0402 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Mon, 12 Dec 2022 15:18:56 +0530 Subject: [PATCH] Typos from the refactor --- ui/sd_internal/model_manager.py | 4 ++-- ui/sd_internal/renderer.py | 6 +++--- ui/sd_internal/task_manager.py | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ui/sd_internal/model_manager.py b/ui/sd_internal/model_manager.py index 0cc9414c..f5e8a5c7 100644 --- a/ui/sd_internal/model_manager.py +++ b/ui/sd_internal/model_manager.py @@ -121,9 +121,9 @@ def resolve_model_paths(task_data: TaskData): def set_vram_optimizations(context: Context, task_data: TaskData): if task_data.turbo: - context.vram_optimizations += {'TURBO'} + context.vram_optimizations.add('TURBO') else: - context.vram_optimizations -= {'TURBO'} + context.vram_optimizations.remove('TURBO') def make_model_folders(): for model_type in KNOWN_MODEL_TYPES: diff --git a/ui/sd_internal/renderer.py b/ui/sd_internal/renderer.py index 2bf079f5..aa805ad9 100644 --- a/ui/sd_internal/renderer.py +++ b/ui/sd_internal/renderer.py @@ -55,7 +55,7 @@ def make_images(req: GenerateImageRequest, task_data: TaskData, data_queue: queu raise e def _make_images_internal(req: GenerateImageRequest, task_data: TaskData, data_queue: queue.Queue, task_temp_images: list, step_callback): - images, user_stopped = generate_images(req, data_queue, task_temp_images, step_callback, task_data.stream_image_progress) + images, user_stopped = generate_images(req, task_data, data_queue, task_temp_images, step_callback, task_data.stream_image_progress) filtered_images = apply_filters(task_data, images, user_stopped) if task_data.save_to_disk_path is not None: @@ -64,10 +64,10 @@ def _make_images_internal(req: GenerateImageRequest, task_data: TaskData, data_q return filtered_images if task_data.show_only_filtered_image else images + filtered_images -def generate_images(req: GenerateImageRequest, data_queue: queue.Queue, task_temp_images: list, step_callback, stream_image_progress: bool): +def generate_images(req: GenerateImageRequest, task_data: TaskData, data_queue: queue.Queue, task_temp_images: list, step_callback, stream_image_progress: bool): context.temp_images.clear() - image_generator.on_image_step = make_step_callback(req, data_queue, task_temp_images, step_callback, stream_image_progress) + image_generator.on_image_step = make_step_callback(req, task_data, data_queue, task_temp_images, step_callback, stream_image_progress) try: images = image_generator.make_images(context=context, req=req) diff --git a/ui/sd_internal/task_manager.py b/ui/sd_internal/task_manager.py index a6d4dadd..ef2a4a3b 100644 --- a/ui/sd_internal/task_manager.py +++ b/ui/sd_internal/task_manager.py @@ -40,12 +40,12 @@ class ServerStates: class RenderTask(): # Task with output queue and completion lock. def __init__(self, req: GenerateImageRequest, task_data: TaskData): - req.request_id = id(self) + task_data.request_id = id(self) self.render_request: GenerateImageRequest = req # Initial Request self.task_data: TaskData = task_data self.response: Any = None # Copy of the last reponse self.render_device = None # Select the task affinity. (Not used to change active devices). - self.temp_images:list = [None] * req.num_outputs * (1 if req.show_only_filtered_image else 2) + self.temp_images:list = [None] * req.num_outputs * (1 if task_data.show_only_filtered_image else 2) self.error: Exception = None self.lock: threading.Lock = threading.Lock() # Locks at task start and unlocks when task is completed self.buffer_queue: queue.Queue = queue.Queue() # Queue of JSON string segments @@ -235,7 +235,9 @@ def thread_render(device): 'alive': True } + current_state = ServerStates.LoadingModel model_manager.load_default_models(renderer.context) + current_state = ServerStates.Online while True: