Spaces:
Runtime error
Runtime error
lalashechka
commited on
Commit
•
2ac6e98
1
Parent(s):
44e8b2a
Update app.py
Browse files
app.py
CHANGED
@@ -147,11 +147,8 @@ def flip_text(prompt, negative_prompt, task, steps, sampler, cfg_scale, seed):
|
|
147 |
|
148 |
def mirror(image_output, scale_by, method, gfpgan, codeformer):
|
149 |
|
150 |
-
url_up =
|
151 |
-
url_up_f =
|
152 |
-
|
153 |
-
print("~~ up", url_up)
|
154 |
-
print("~~ f", url_up_f)
|
155 |
|
156 |
scale_by = int(scale_by)
|
157 |
gfpgan = int(gfpgan)
|
@@ -164,9 +161,9 @@ def mirror(image_output, scale_by, method, gfpgan, codeformer):
|
|
164 |
encoded_string2 = "data:image/png;base64," + encoded_string2
|
165 |
data = {"fn_index":81,"data":[0,0,encoded_string2,None,"","",True,gfpgan,codeformer,0,scale_by,512,512,None,method,"None",1,False,[],"",""],"session_hash":""}
|
166 |
print(data)
|
167 |
-
r = requests.post(
|
168 |
print(r.text)
|
169 |
-
ph =
|
170 |
return ph
|
171 |
|
172 |
css = """
|
|
|
147 |
|
148 |
def mirror(image_output, scale_by, method, gfpgan, codeformer):
|
149 |
|
150 |
+
url_up = "https://darkstorm2150-protogen-web-ui.hf.space/run/predict/"
|
151 |
+
url_up_f = "https://darkstorm2150-protogen-web-ui.hf.space/file="
|
|
|
|
|
|
|
152 |
|
153 |
scale_by = int(scale_by)
|
154 |
gfpgan = int(gfpgan)
|
|
|
161 |
encoded_string2 = "data:image/png;base64," + encoded_string2
|
162 |
data = {"fn_index":81,"data":[0,0,encoded_string2,None,"","",True,gfpgan,codeformer,0,scale_by,512,512,None,method,"None",1,False,[],"",""],"session_hash":""}
|
163 |
print(data)
|
164 |
+
r = requests.post({url_up}, json=data, timeout=100)
|
165 |
print(r.text)
|
166 |
+
ph = url_up_f + str(r.json()['data'][0][0]['name'])
|
167 |
return ph
|
168 |
|
169 |
css = """
|