Update app.py
Browse files
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
|
| 36 |
|
| 37 |
|
| 38 |
demo = gr.Interface(
|
| 39 |
fn=gen_image,
|
| 40 |
inputs=["text", "text"],
|
| 41 |
-
outputs=
|
| 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()
|