Spaces:
Runtime error
Runtime error
jacktheporsche
commited on
Commit
•
4f6eb33
1
Parent(s):
6f32ecd
Update app.py
Browse files
app.py
CHANGED
@@ -130,86 +130,81 @@ with gr.Blocks(css="style.css") as demo:
|
|
130 |
elem_id="subtitle",
|
131 |
)
|
132 |
gr.DuplicateButton(
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
aspect_ratio_selector = gr.Radio(
|
137 |
label="Aspect Ratio",
|
138 |
choices=config.aspect_ratios,
|
139 |
value="1024 x 1024",
|
140 |
container=True,
|
141 |
-
|
142 |
-
|
143 |
-
with gr.
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
value=1024,
|
151 |
-
)
|
152 |
-
custom_height = gr.Slider(
|
153 |
-
label="Height",
|
154 |
-
minimum=MIN_IMAGE_SIZE,
|
155 |
-
maximum=MAX_IMAGE_SIZE,
|
156 |
-
step=8,
|
157 |
-
value=1024,
|
158 |
-
)
|
159 |
-
use_upscaler = gr.Checkbox(label="Use Upscaler", value=False)
|
160 |
-
with gr.Row() as upscaler_row:
|
161 |
-
upscaler_strength = gr.Slider(
|
162 |
-
label="Strength",
|
163 |
-
minimum=0,
|
164 |
-
maximum=1,
|
165 |
-
step=0.05,
|
166 |
-
value=0.55,
|
167 |
-
visible=False,
|
168 |
)
|
169 |
-
|
170 |
-
label="
|
171 |
-
minimum=
|
172 |
-
maximum=
|
173 |
-
step=
|
174 |
-
value=
|
175 |
-
visible=False,
|
176 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
|
|
|
|
|
|
|
|
183 |
)
|
|
|
|
|
184 |
with gr.Row():
|
185 |
-
|
186 |
-
label="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
)
|
188 |
-
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
189 |
-
with gr.Group():
|
190 |
-
with gr.Row():
|
191 |
-
guidance_scale = gr.Slider(
|
192 |
-
label="Guidance scale",
|
193 |
-
minimum=1,
|
194 |
-
maximum=12,
|
195 |
-
step=0.1,
|
196 |
-
value=7.0,
|
197 |
-
)
|
198 |
-
num_inference_steps = gr.Slider(
|
199 |
-
label="Number of inference steps",
|
200 |
-
minimum=1,
|
201 |
-
maximum=100,
|
202 |
-
step=1,
|
203 |
-
value=28,
|
204 |
-
)
|
205 |
with gr.Accordion(label="Generation Parameters", open=False):
|
206 |
gr_metadata = gr.JSON(label="Metadata", show_label=False)
|
207 |
gr.Examples(
|
208 |
examples=config.examples,
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
inputs=prompt,
|
214 |
outputs=[result, gr_metadata],
|
215 |
fn=lambda *args, **kwargs: generate(*args, use_upscaler=True, **kwargs),
|
@@ -280,4 +275,4 @@ with gr.Blocks(css="style.css") as demo:
|
|
280 |
api_name=False,
|
281 |
)
|
282 |
|
283 |
-
demo.queue(max_size=20).launch(debug=IS_COLAB, share=IS_COLAB, show_error=True)
|
|
|
130 |
elem_id="subtitle",
|
131 |
)
|
132 |
gr.DuplicateButton(
|
133 |
+
placeholder="Enter a negative prompt",
|
134 |
+
value=""
|
135 |
+
)
|
136 |
aspect_ratio_selector = gr.Radio(
|
137 |
label="Aspect Ratio",
|
138 |
choices=config.aspect_ratios,
|
139 |
value="1024 x 1024",
|
140 |
container=True,
|
141 |
+
)
|
142 |
+
with gr.Group(visible=False) as custom_resolution:
|
143 |
+
with gr.Row():
|
144 |
+
custom_width = gr.Slider(
|
145 |
+
label="Width",
|
146 |
+
minimum=MIN_IMAGE_SIZE,
|
147 |
+
maximum=MAX_IMAGE_SIZE,
|
148 |
+
step=8,
|
149 |
+
value=1024,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
)
|
151 |
+
custom_height = gr.Slider(
|
152 |
+
label="Height",
|
153 |
+
minimum=MIN_IMAGE_SIZE,
|
154 |
+
maximum=MAX_IMAGE_SIZE,
|
155 |
+
step=8,
|
156 |
+
value=1024,
|
|
|
157 |
)
|
158 |
+
use_upscaler = gr.Checkbox(label="Use Upscaler", value=False)
|
159 |
+
with gr.Row() as upscaler_row:
|
160 |
+
upscaler_strength = gr.Slider(
|
161 |
+
label="Strength",
|
162 |
+
minimum=0,
|
163 |
+
maximum=1,
|
164 |
+
step=0.05,
|
165 |
+
value=0.55,
|
166 |
+
visible=False,
|
167 |
+
)
|
168 |
+
upscale_by = gr.Slider(
|
169 |
+
label="Upscale by",
|
170 |
+
minimum=1,
|
171 |
+
maximum=1.5,
|
172 |
+
step=0.1,
|
173 |
+
value=1.5,
|
174 |
+
visible=False,
|
175 |
+
)
|
176 |
|
177 |
+
sampler = gr.Dropdown(
|
178 |
+
label="Sampler",
|
179 |
+
choices=config.sampler_list,
|
180 |
+
interactive=True,
|
181 |
+
value="DPM++ 2M SDE Karras",
|
182 |
+
)
|
183 |
+
with gr.Row():
|
184 |
+
seed = gr.Slider(
|
185 |
+
label="Seed", minimum=0, maximum=utils.MAX_SEED, step=1, value=0
|
186 |
)
|
187 |
+
randomize_seed = gr.Checkbox(label="Randomize seed", value=True)
|
188 |
+
with gr.Group():
|
189 |
with gr.Row():
|
190 |
+
guidance_scale = gr.Slider(
|
191 |
+
label="Guidance scale",
|
192 |
+
minimum=1,
|
193 |
+
maximum=12,
|
194 |
+
step=0.1,
|
195 |
+
value=7.0,
|
196 |
+
)
|
197 |
+
num_inference_steps = gr.Slider(
|
198 |
+
label="Number of inference steps",
|
199 |
+
minimum=1,
|
200 |
+
maximum=100,
|
201 |
+
step=1,
|
202 |
+
value=28,
|
203 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
with gr.Accordion(label="Generation Parameters", open=False):
|
205 |
gr_metadata = gr.JSON(label="Metadata", show_label=False)
|
206 |
gr.Examples(
|
207 |
examples=config.examples,
|
|
|
|
|
|
|
|
|
208 |
inputs=prompt,
|
209 |
outputs=[result, gr_metadata],
|
210 |
fn=lambda *args, **kwargs: generate(*args, use_upscaler=True, **kwargs),
|
|
|
275 |
api_name=False,
|
276 |
)
|
277 |
|
278 |
+
demo.queue(max_size=20).launch(debug=IS_COLAB, share=IS_COLAB, show_error=True)
|