Update app.py
Browse files
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+=
|
41 |
out = Image.open(io.BytesIO(r.content))
|
42 |
out_box.append(out)
|
43 |
-
|
44 |
-
yield out_box,
|
45 |
except Exception as e:
|
46 |
out_html+=e
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|