Spaces:
Runtime error
Runtime error
Logan Zoellner
commited on
Commit
•
76a2568
1
Parent(s):
b2649ae
gah! I've seen this bug before
Browse files
app.py
CHANGED
@@ -1,5 +1,10 @@
|
|
1 |
from asyncio import constants
|
2 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
|
5 |
def generate_image(text):
|
@@ -8,9 +13,13 @@ def generate_image(text):
|
|
8 |
print("calling interface",text)
|
9 |
img=dalle(text)
|
10 |
|
|
|
|
|
|
|
|
|
11 |
|
12 |
gfpgan=gr.Interface.load("spaces/akhaliq/GFPGAN")
|
13 |
-
img2=dalle(
|
14 |
|
15 |
|
16 |
return img2
|
|
|
1 |
from asyncio import constants
|
2 |
import gradio as gr
|
3 |
+
import requests
|
4 |
+
import os
|
5 |
+
from base64 import b64decode
|
6 |
+
from PIL import Image
|
7 |
+
import io
|
8 |
|
9 |
|
10 |
def generate_image(text):
|
|
|
13 |
print("calling interface",text)
|
14 |
img=dalle(text)
|
15 |
|
16 |
+
header, encoded = img.split(",", 1)
|
17 |
+
data = b64decode(encoded)
|
18 |
+
image = Image.open(io.BytesIO(data))
|
19 |
+
|
20 |
|
21 |
gfpgan=gr.Interface.load("spaces/akhaliq/GFPGAN")
|
22 |
+
img2=dalle(image)
|
23 |
|
24 |
|
25 |
return img2
|