From 90839430da4cd0badff2f718f1365fd81e00b673 Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Sat, 2 Mar 2024 19:05:11 +0100 Subject: [PATCH 1/2] fix: adjust parameters for upscale fast 2x (#2411) --- modules/async_worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/async_worker.py b/modules/async_worker.py index 2c029cfb..908cc8c2 100644 --- a/modules/async_worker.py +++ b/modules/async_worker.py @@ -553,8 +553,8 @@ def worker(): direct_return = False if direct_return: - d = [('Upscale (Fast)', '2x')] - uov_input_image_path = log(uov_input_image, d, output_format) + d = [('Upscale (Fast)', 'upscale_fast', '2x')] + uov_input_image_path = log(uov_input_image, d, output_format=output_format) yield_result(async_task, uov_input_image_path, do_not_show_finished_images=True) return From 4ea3baff501f876f1e1e6628491b56fb5a3832ee Mon Sep 17 00:00:00 2001 From: Manuel Schmid <9307310+mashb1t@users.noreply.github.com> Date: Sun, 3 Mar 2024 00:21:59 +0100 Subject: [PATCH 2/2] fix: add handling for filepaths to image grid (#2414) previously skipped due to not being in np.ndarray format but string --- modules/async_worker.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/async_worker.py b/modules/async_worker.py index 908cc8c2..fd785f07 100644 --- a/modules/async_worker.py +++ b/modules/async_worker.py @@ -22,6 +22,7 @@ def worker(): import traceback import math import numpy as np + import cv2 import torch import time import shared @@ -79,16 +80,20 @@ def worker(): return def build_image_wall(async_task): - results = async_task.results + results = [] - if len(results) < 2: + if len(async_task.results) < 2: return - for img in results: + for img in async_task.results: + if isinstance(img, str) and os.path.exists(img): + img = cv2.imread(img) + img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) if not isinstance(img, np.ndarray): return if img.ndim != 3: return + results.append(img) H, W, C = results[0].shape