mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
Merge branch 'main_upstream'
# Conflicts: # modules/async_worker.py
This commit is contained in:
@@ -24,6 +24,7 @@ def worker():
|
|||||||
import traceback
|
import traceback
|
||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import cv2
|
||||||
import torch
|
import torch
|
||||||
import time
|
import time
|
||||||
import shared
|
import shared
|
||||||
@@ -87,16 +88,20 @@ def worker():
|
|||||||
return
|
return
|
||||||
|
|
||||||
def build_image_wall(async_task):
|
def build_image_wall(async_task):
|
||||||
results = async_task.results
|
results = []
|
||||||
|
|
||||||
if len(results) < 2:
|
if len(async_task.results) < 2:
|
||||||
return
|
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):
|
if not isinstance(img, np.ndarray):
|
||||||
return
|
return
|
||||||
if img.ndim != 3:
|
if img.ndim != 3:
|
||||||
return
|
return
|
||||||
|
results.append(img)
|
||||||
|
|
||||||
H, W, C = results[0].shape
|
H, W, C = results[0].shape
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user