@@ -43,7 +43,7 @@ def describe_image(self, image, prompt, max_tokens, temp, top_p, model, api_key,
43
43
#Convert from image tensor to array
44
44
image_np = 255. * image .cpu ().numpy ().squeeze ()
45
45
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 )
47
47
#upload image
48
48
buffered = io .BytesIO ()
49
49
img .save (buffered , format = "PNG" )
@@ -301,7 +301,7 @@ def generate_image(self, loras, prompt, width, height, steps, api_key, seed, cfg
301
301
#Convert from image tensor to array
302
302
image_np = 255. * image .cpu ().numpy ().squeeze ()
303
303
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 )
305
305
#downscale image to prevent excess cost
306
306
width , height = img .size #get size for checking
307
307
max_dimension = max (width , height )
@@ -365,7 +365,7 @@ def generate_image(self, image, prompt, strength, steps, api_key, seed, cfg, no_
365
365
#Convert from image tensor to array
366
366
image_np = 255. * image .cpu ().numpy ().squeeze ()
367
367
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 )
369
369
#downscale image to prevent excess cost
370
370
width , height = img .size #get size for checking
371
371
max_dimension = max (width , height )
0 commit comments