Spaces:
Runtime error
Runtime error
replace stuff.
Browse files
app.py
CHANGED
@@ -51,21 +51,27 @@ with block:
|
|
51 |
<rect x="23" y="69" width="23" height="23" fill="black"></rect>
|
52 |
</svg>
|
53 |
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
54 |
-
|
55 |
</h1>
|
56 |
</div>
|
57 |
<p style="margin-bottom: 10px; font-size: 94%; line-height: 23px;">
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
</p>
|
61 |
</div>
|
62 |
"""
|
63 |
)
|
64 |
with gr.Group():
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
label="Enter your prompt",
|
70 |
show_label=False,
|
71 |
max_lines=1,
|
@@ -76,7 +82,7 @@ with block:
|
|
76 |
rounded=(True, False, False, True),
|
77 |
container=False,
|
78 |
)
|
79 |
-
|
80 |
label="Enter your negative prompt",
|
81 |
show_label=False,
|
82 |
max_lines=1,
|
@@ -87,34 +93,11 @@ with block:
|
|
87 |
rounded=(True, False, False, True),
|
88 |
container=False,
|
89 |
)
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
gr.HTML(
|
96 |
-
"""
|
97 |
-
<div class="acknowledgments">
|
98 |
-
<p><h4>How it works?</h4>
|
99 |
-
<ul>
|
100 |
-
<li> The evaluator first sets a seed and then generates the initial noise which is passed as the initial latent to start the image generation process. It is done to ensure fair comparison.</li>
|
101 |
-
<li>This initial latent is used every time the pipeline is run (with different schedulers).</li>
|
102 |
-
<li>To quantify the quality of the generated images we use:</li>
|
103 |
-
<ul>
|
104 |
-
<li><a href=https://en.wikipedia.org/wiki/Inception_score>Inception Score</a></li>
|
105 |
-
<li><a href=https://arxiv.org/abs/2104.08718>Clip Score</a></li>
|
106 |
-
</ul>
|
107 |
-
</ul></p>
|
108 |
-
<p><h4>Notes</h4>
|
109 |
-
<ul>
|
110 |
-
<li>The default scheduler associated with the provided checkpoint is always used for reporting the scores.</li>
|
111 |
-
<li>Increasing both the number of images per prompt and the number of inference steps could quickly build up the inference queue and thus
|
112 |
-
resulting in slowdowns.</li>
|
113 |
-
</ul>
|
114 |
-
</p>
|
115 |
-
</div>
|
116 |
-
"""
|
117 |
-
)
|
118 |
|
119 |
|
120 |
block.launch()
|
|
|
51 |
<rect x="23" y="69" width="23" height="23" fill="black"></rect>
|
52 |
</svg>
|
53 |
<h1 style="font-weight: 900; margin-bottom: 7px;margin-top:5px">
|
54 |
+
Stable Diffusion 2.1 Demo
|
55 |
</h1>
|
56 |
</div>
|
57 |
<p style="margin-bottom: 10px; font-size: 94%; line-height: 23px;">
|
58 |
+
Stable Diffusion 2.1 is the latest text-to-image model from StabilityAI. <a style="text-decoration: underline;" href="https://huggingface.co/spaces/stabilityai/stable-diffusion-1">Access Stable Diffusion 1 Space here</a><br>For faster generation and API
|
59 |
+
access you can try
|
60 |
+
<a
|
61 |
+
href="http://beta.dreamstudio.ai/"
|
62 |
+
style="text-decoration: underline;"
|
63 |
+
target="_blank"
|
64 |
+
>DreamStudio Beta</a
|
65 |
+
>.</a>
|
66 |
</p>
|
67 |
</div>
|
68 |
"""
|
69 |
)
|
70 |
with gr.Group():
|
71 |
+
with gr.Box():
|
72 |
+
with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
|
73 |
+
with gr.Column():
|
74 |
+
text = gr.Textbox(
|
75 |
label="Enter your prompt",
|
76 |
show_label=False,
|
77 |
max_lines=1,
|
|
|
82 |
rounded=(True, False, False, True),
|
83 |
container=False,
|
84 |
)
|
85 |
+
negative = gr.Textbox(
|
86 |
label="Enter your negative prompt",
|
87 |
show_label=False,
|
88 |
max_lines=1,
|
|
|
93 |
rounded=(True, False, False, True),
|
94 |
container=False,
|
95 |
)
|
96 |
+
btn = gr.Button("Generate image").style(
|
97 |
+
margin=False,
|
98 |
+
rounded=(False, True, True, False),
|
99 |
+
full_width=False,
|
100 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
|
102 |
|
103 |
block.launch()
|