Omnibus commited on
Commit
b87e516
1 Parent(s): 6642a1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -37,15 +37,23 @@ def run_dif(out_prompt):
37
  print (f'bytes:: {io.BytesIO(r.content)}')
38
  str_equivalent_image = base64.b64encode(img_buffer.getvalue()).decode()
39
  img_tag = "<img src='data:image/png;base64," + str_equivalent_image + "'/>"
40
- out_html+=out_html+"<div>"+img_tag+"</div>"
41
  out = Image.open(io.BytesIO(r.content))
42
  out_box.append(out)
43
-
44
- yield out_box,out_html
45
  except Exception as e:
46
  out_html+=e
47
- yield out_box,out_html
48
- with gr.Blocks() as app:
 
 
 
 
 
 
 
 
49
  inp=gr.Textbox()
50
  out_html=gr.HTML()
51
  outp=gr.Gallery()
 
37
  print (f'bytes:: {io.BytesIO(r.content)}')
38
  str_equivalent_image = base64.b64encode(img_buffer.getvalue()).decode()
39
  img_tag = "<img src='data:image/png;base64," + str_equivalent_image + "'/>"
40
+ out_html+=f"<div><a href='https://huggingface.co/models/{ea}'>{ea}</a><br>"+img_tag+"</div>"
41
  out = Image.open(io.BytesIO(r.content))
42
  out_box.append(out)
43
+ html_out = "<div class='grid_class'>"+out_html+"</div>"
44
+ yield out_box,html_out
45
  except Exception as e:
46
  out_html+=e
47
+ html_out = "<div class='grid_class'>"+out_html+"</div>"
48
+
49
+ yield out_box,html_out
50
+ css="""
51
+ .grid_class{
52
+ display:flex;
53
+ }
54
+
55
+ """
56
+ with gr.Blocks(css=css) as app:
57
  inp=gr.Textbox()
58
  out_html=gr.HTML()
59
  outp=gr.Gallery()