helloway commited on
Commit
cc63969
·
1 Parent(s): 73944b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -31,13 +31,14 @@ def gen_image(desc: str, style: str):
31
  # image = Image.fromarray(np.uint8(img_np))
32
  img_rep = requests.get(resp_data['output_image_url'][0])
33
  image = Image.open(BytesIO(img_rep.content))
 
34
 
35
- return [image]
36
 
37
 
38
  demo = gr.Interface(
39
  fn=gen_image,
40
  inputs=["text", "text"],
41
- outputs=["image"],
42
  )
43
  demo.launch()
 
31
  # image = Image.fromarray(np.uint8(img_np))
32
  img_rep = requests.get(resp_data['output_image_url'][0])
33
  image = Image.open(BytesIO(img_rep.content))
34
+ image_np = np.asarray(image)
35
 
36
+ return image_np
37
 
38
 
39
  demo = gr.Interface(
40
  fn=gen_image,
41
  inputs=["text", "text"],
42
+ outputs=gr.outputs.Image(type='numpy'),
43
  )
44
  demo.launch()