lalashechka commited on
Commit
300e1a9
1 Parent(s): 3a1dbf3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -165,7 +165,9 @@ def mirror(image_output, scale_by, method, gfpgan, codeformer):
165
  print(r.json()['data'][0][0]['name'])
166
  ph = "https://darkstorm2150-protogen-web-ui.hf.space/file=" + str(r.json()['data'][0][0]['name'])
167
  print(ph)
168
- return ph
 
 
169
 
170
  css = """
171
  #generate {
@@ -229,7 +231,7 @@ with gr.Blocks(css=css) as demo:
229
  text_button.click(flip_text, inputs=[prompt, negative_prompt, task, steps, sampler, cfg_scale, seed], outputs=image_output, concurrency_limit=10)
230
 
231
  img2img_b = gr.Button("Увеличить изображение", variant='secondary')
232
- image_i2i = gr.Image(show_label=True, label='Увеличенное изображение:', type='filepath')
233
  img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=10)
234
 
235
  demo.launch()
 
165
  print(r.json()['data'][0][0]['name'])
166
  ph = "https://darkstorm2150-protogen-web-ui.hf.space/file=" + str(r.json()['data'][0][0]['name'])
167
  print(ph)
168
+ response2 = requests.get(ph)
169
+ img = Image.open(BytesIO(response2.content))
170
+ return img
171
 
172
  css = """
173
  #generate {
 
231
  text_button.click(flip_text, inputs=[prompt, negative_prompt, task, steps, sampler, cfg_scale, seed], outputs=image_output, concurrency_limit=10)
232
 
233
  img2img_b = gr.Button("Увеличить изображение", variant='secondary')
234
+ image_i2i = gr.Image(show_label=True, label='Увеличенное изображение:')
235
  img2img_b.click(mirror, inputs=[image_output, scale_by, method, gfpgan, codeformer], outputs=image_i2i, concurrency_limit=10)
236
 
237
  demo.launch()