hayaboy commited on
Commit
1891031
β€’
1 Parent(s): e83d07f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
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():