Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add handling for filepaths to image grid #2414

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions modules/async_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def worker():
import traceback
import math
import numpy as np
import cv2
import torch
import time
import shared
Expand Down Expand Up @@ -79,16 +80,20 @@ def yield_result(async_task, imgs, do_not_show_finished_images=False):
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

Expand Down