Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -65,6 +65,29 @@ def sd_call(prompt, width, height):
|
|
65 |
return image_link, fetch_result
|
66 |
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
with gr.Blocks(theme=gr.themes.Default()) as app:
|
69 |
with gr.Tab("μ½ν μμ±"):
|
70 |
with gr.Row():
|
|
|
65 |
return image_link, fetch_result
|
66 |
|
67 |
|
68 |
+
|
69 |
+
def sd_recall(fetch_result):
|
70 |
+
url = fetch_result
|
71 |
+
payload = json.dumps({
|
72 |
+
"key": "xbYWUXEs8U4iUweAQjOoH6mrasutoExqC3a2H6NtlnYAWTRXui9y0t2w1g8P"
|
73 |
+
})
|
74 |
+
headers = {
|
75 |
+
'Content-Type': 'application/json'
|
76 |
+
}
|
77 |
+
response = requests.request("POST", url, headers=headers, data=payload)
|
78 |
+
response_data = json.loads(response.text)
|
79 |
+
image_link = response_data["output"]
|
80 |
+
|
81 |
+
if not image_link:
|
82 |
+
image_link = None
|
83 |
+
else:
|
84 |
+
image_link = image_link[0]
|
85 |
+
return image_link
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
with gr.Blocks(theme=gr.themes.Default()) as app:
|
92 |
with gr.Tab("μ½ν μμ±"):
|
93 |
with gr.Row():
|