Skip to content

Commit aadf07b

Browse files
committed
fix stupid image conversion mistake (don't look it's embarrassing)
1 parent 36c1c65 commit aadf07b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nodes.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def describe_image(self, image, prompt, max_tokens, temp, top_p, model, api_key,
4343
#Convert from image tensor to array
4444
image_np = 255. * image.cpu().numpy().squeeze()
4545
image_np = np.clip(image_np, 0, 255).astype(np.uint8)
46-
img = Image.fromarray(image_np).convert('L')
46+
img = Image.fromarray(image_np)
4747
#upload image
4848
buffered = io.BytesIO()
4949
img.save(buffered, format="PNG")
@@ -301,7 +301,7 @@ def generate_image(self, loras, prompt, width, height, steps, api_key, seed, cfg
301301
#Convert from image tensor to array
302302
image_np = 255. * image.cpu().numpy().squeeze()
303303
image_np = np.clip(image_np, 0, 255).astype(np.uint8)
304-
img = Image.fromarray(image_np).convert('L')
304+
img = Image.fromarray(image_np)
305305
#downscale image to prevent excess cost
306306
width, height = img.size #get size for checking
307307
max_dimension = max(width, height)
@@ -365,7 +365,7 @@ def generate_image(self, image, prompt, strength, steps, api_key, seed, cfg, no_
365365
#Convert from image tensor to array
366366
image_np = 255. * image.cpu().numpy().squeeze()
367367
image_np = np.clip(image_np, 0, 255).astype(np.uint8)
368-
img = Image.fromarray(image_np).convert('L')
368+
img = Image.fromarray(image_np)
369369
#downscale image to prevent excess cost
370370
width, height = img.size #get size for checking
371371
max_dimension = max(width, height)

0 commit comments

Comments
 (0)