Import fix
This commit is contained in:
+3
-3
@@ -4,7 +4,7 @@ import numpy as np
|
||||
|
||||
from PIL import Image
|
||||
from io import BytesIO
|
||||
from torch import Tensor
|
||||
import torch
|
||||
|
||||
|
||||
class LoadImageFromBase64:
|
||||
@@ -24,7 +24,7 @@ class LoadImageFromBase64:
|
||||
code = cv2.COLOR_BGRA2RGB if image.ndim > 2 and image.shape[2] >= 4 else cv2.COLOR_BGR2RGB
|
||||
return cv2.cvtColor(image, code)
|
||||
|
||||
def main(self, data: str) -> tuple[Tensor, Tensor]:
|
||||
def main(self, data: str) -> tuple[torch.Tensor, torch.Tensor]:
|
||||
nparr = np.frombuffer(base64.b64decode(data), np.uint8)
|
||||
|
||||
result = cv2.imdecode(nparr, cv2.IMREAD_UNCHANGED)
|
||||
@@ -58,7 +58,7 @@ class ConvertImageToBase64:
|
||||
OUTPUT_NODE = True
|
||||
CATEGORY = "image"
|
||||
|
||||
def main(self, images: Tensor) -> list[dict[str, str]]:
|
||||
def main(self, images: torch.Tensor) -> list[dict[str, str]]:
|
||||
results: list[dict[str, str]] = list()
|
||||
|
||||
for image in images:
|
||||
|
||||
Reference in New Issue
Block a user