Update app.py
Browse files
app.py
CHANGED
@@ -45,17 +45,40 @@ title = """
|
|
45 |
</div>
|
46 |
<p style="margin-bottom: 10px; font-size: 94%">
|
47 |
Text-Based Real Image Editing with Diffusion Models
|
|
|
48 |
</p>
|
49 |
</div>
|
50 |
"""
|
51 |
|
52 |
article = """
|
53 |
-
|
|
|
|
|
|
|
54 |
"""
|
55 |
|
56 |
css = '''
|
57 |
#col-container {max-width: 700px; margin-left: auto; margin-right: auto;}
|
58 |
a {text-decoration-line: underline; font-weight: 600;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
'''
|
60 |
|
61 |
|
@@ -63,12 +86,12 @@ with gr.Blocks(css=css) as block:
|
|
63 |
with gr.Column(elem_id="col-container"):
|
64 |
gr.HTML(title)
|
65 |
|
66 |
-
prompt_input = gr.Textbox()
|
67 |
-
image_init = gr.Image(source="upload", type="filepath")
|
68 |
|
69 |
submit_btn = gr.Button("Submit")
|
70 |
|
71 |
-
image_output = gr.Image()
|
72 |
|
73 |
#gr.HTML(article)
|
74 |
|
|
|
45 |
</div>
|
46 |
<p style="margin-bottom: 10px; font-size: 94%">
|
47 |
Text-Based Real Image Editing with Diffusion Models
|
48 |
+
<br />This pipeline aims to implement <a href="" target="_blank">this paper</a> to Stable Diffusion, allowing for real-world image editing.
|
49 |
</p>
|
50 |
</div>
|
51 |
"""
|
52 |
|
53 |
article = """
|
54 |
+
<div class="footer">
|
55 |
+
<p><a href="https://github.com/huggingface/diffusers/tree/main/examples/community#imagic-stable-diffusion" target="_blank">Community pipeline</a> baked by <a href="https://github.com/apolinario" style="text-decoration: underline;" target="_blank">@apolinario</a> - Gradio Demo by 🤗 Sylvain Filoni
|
56 |
+
</p>
|
57 |
+
</div>
|
58 |
"""
|
59 |
|
60 |
css = '''
|
61 |
#col-container {max-width: 700px; margin-left: auto; margin-right: auto;}
|
62 |
a {text-decoration-line: underline; font-weight: 600;}
|
63 |
+
.footer {
|
64 |
+
margin-bottom: 45px;
|
65 |
+
margin-top: 35px;
|
66 |
+
text-align: center;
|
67 |
+
border-bottom: 1px solid #e5e5e5;
|
68 |
+
}
|
69 |
+
.footer>p {
|
70 |
+
font-size: .8rem;
|
71 |
+
display: inline-block;
|
72 |
+
padding: 0 10px;
|
73 |
+
transform: translateY(10px);
|
74 |
+
background: white;
|
75 |
+
}
|
76 |
+
.dark .footer {
|
77 |
+
border-color: #303030;
|
78 |
+
}
|
79 |
+
.dark .footer>p {
|
80 |
+
background: #0b0f19;
|
81 |
+
}
|
82 |
'''
|
83 |
|
84 |
|
|
|
86 |
with gr.Column(elem_id="col-container"):
|
87 |
gr.HTML(title)
|
88 |
|
89 |
+
prompt_input = gr.Textbox(label="Prompt", placeholder="Describe the image with what you want to change about the subject")
|
90 |
+
image_init = gr.Image(source="upload", type="filepath", label="Input Image")
|
91 |
|
92 |
submit_btn = gr.Button("Submit")
|
93 |
|
94 |
+
image_output = gr.Image(label="Result")
|
95 |
|
96 |
#gr.HTML(article)
|
97 |
|