Spaces:
Running
on
Zero
Running
on
Zero
tight-inversion
commited on
Commit
·
896cebe
1
Parent(s):
56a3023
Update examples
Browse files
app.py
CHANGED
|
@@ -325,7 +325,7 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
|
|
| 325 |
|
| 326 |
width = gr.Slider(256, 1536, 1024, step=16, label="Width", visible=args.dev)
|
| 327 |
height = gr.Slider(256, 1536, 1024, step=16, label="Height", visible=args.dev)
|
| 328 |
-
num_steps = gr.Slider(1,
|
| 329 |
guidance = gr.Slider(1.0, 10.0, 3.5, step=0.1, label="Guidance")
|
| 330 |
|
| 331 |
with gr.Accordion("Advanced Options (True CFG, true_cfg_scale=1 means use fake CFG, >1 means use true CFG", open=False): # noqa E501
|
|
@@ -340,7 +340,7 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
|
|
| 340 |
label="max_sequence_length for prompt (T5), small will be faster")
|
| 341 |
gr.Markdown("### RF Inversion Options")
|
| 342 |
gamma = gr.Slider(0.0, 1.0, 0.5, step=0.1, label="gamma")
|
| 343 |
-
eta = gr.Slider(0.0, 1.0, 0.
|
| 344 |
s = gr.Slider(0.0, 1.0, 0.0, step=0.1, label="s")
|
| 345 |
tau = gr.Slider(0, 20, 2, step=1, label="tau")
|
| 346 |
|
|
@@ -355,43 +355,33 @@ def create_demo(args, model_name: str, device: str = "cuda" if torch.cuda.is_ava
|
|
| 355 |
with gr.Row(), gr.Column():
|
| 356 |
gr.Markdown("## Examples")
|
| 357 |
example_inps = [
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
[
|
| 364 |
'a portrait of a zombie',
|
| 365 |
'example_inputs/unsplash/baruk-granda-cfLL_jHQ-Iw-unsplash.jpg',
|
| 366 |
-
0.4, 3.5, 42, 5.0
|
| 367 |
],
|
| 368 |
[
|
| 369 |
'a portrait of an elf',
|
| 370 |
-
'example_inputs/unsplash/
|
| 371 |
-
0.5, 3.5, 42, 5.0
|
| 372 |
-
],
|
| 373 |
-
[
|
| 374 |
-
'a portrait of a clown',
|
| 375 |
-
'example_inputs/unsplash/lhon-karwan-11tbHtK5STE-unsplash.jpg',
|
| 376 |
-
0.5, 3.5, 42, 3.5
|
| 377 |
],
|
| 378 |
[
|
| 379 |
-
'a portrait of
|
| 380 |
-
'example_inputs/unsplash/
|
| 381 |
-
0.
|
| 382 |
],
|
| 383 |
-
# [
|
| 384 |
-
# 'a portrait of a pirate',
|
| 385 |
-
# 'example_inputs/unsplash/mina-rad-AEVUFpDGxZM-unsplash.jpg',
|
| 386 |
-
# 0.3, 3.5, 42, 3.5
|
| 387 |
-
# ],
|
| 388 |
[
|
| 389 |
'a portrait of a superhero',
|
| 390 |
'example_inputs/unsplash/gus-tu-njana-Mf4MN7MZqcE-unsplash.jpg',
|
| 391 |
-
0.2, 3.5, 42, 5.0
|
| 392 |
],
|
| 393 |
]
|
| 394 |
-
gr.Examples(examples=example_inps, inputs=[prompt, id_image, id_weight, guidance, seed, true_cfg])
|
| 395 |
|
| 396 |
generate_btn.click(
|
| 397 |
fn=generate_image,
|
|
|
|
| 325 |
|
| 326 |
width = gr.Slider(256, 1536, 1024, step=16, label="Width", visible=args.dev)
|
| 327 |
height = gr.Slider(256, 1536, 1024, step=16, label="Height", visible=args.dev)
|
| 328 |
+
num_steps = gr.Slider(1, 20, 16, step=1, label="Number of steps")
|
| 329 |
guidance = gr.Slider(1.0, 10.0, 3.5, step=0.1, label="Guidance")
|
| 330 |
|
| 331 |
with gr.Accordion("Advanced Options (True CFG, true_cfg_scale=1 means use fake CFG, >1 means use true CFG", open=False): # noqa E501
|
|
|
|
| 340 |
label="max_sequence_length for prompt (T5), small will be faster")
|
| 341 |
gr.Markdown("### RF Inversion Options")
|
| 342 |
gamma = gr.Slider(0.0, 1.0, 0.5, step=0.1, label="gamma")
|
| 343 |
+
eta = gr.Slider(0.0, 1.0, 0.8, step=0.1, label="eta")
|
| 344 |
s = gr.Slider(0.0, 1.0, 0.0, step=0.1, label="s")
|
| 345 |
tau = gr.Slider(0, 20, 2, step=1, label="tau")
|
| 346 |
|
|
|
|
| 355 |
with gr.Row(), gr.Column():
|
| 356 |
gr.Markdown("## Examples")
|
| 357 |
example_inps = [
|
| 358 |
+
[
|
| 359 |
+
'a portrait of a clown',
|
| 360 |
+
'example_inputs/unsplash/lhon-karwan-11tbHtK5STE-unsplash.jpg',
|
| 361 |
+
0.5, 3.5, 42, 5.0, 0.7
|
| 362 |
+
],
|
| 363 |
[
|
| 364 |
'a portrait of a zombie',
|
| 365 |
'example_inputs/unsplash/baruk-granda-cfLL_jHQ-Iw-unsplash.jpg',
|
| 366 |
+
0.4, 3.5, 42, 5.0, 0.7
|
| 367 |
],
|
| 368 |
[
|
| 369 |
'a portrait of an elf',
|
| 370 |
+
'example_inputs/unsplash/masoud-razeghi--qsrZhXPius-unsplash.jpg',
|
| 371 |
+
0.5, 3.5, 42, 5.0, 0.7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 372 |
],
|
| 373 |
[
|
| 374 |
+
'a portrait of a demon',
|
| 375 |
+
'example_inputs/unsplash/marcin-sajur-nZdMgqvYPBY-unsplash.jpg',
|
| 376 |
+
0.3, 3.5, 42, 5.0, 0.7
|
| 377 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 378 |
[
|
| 379 |
'a portrait of a superhero',
|
| 380 |
'example_inputs/unsplash/gus-tu-njana-Mf4MN7MZqcE-unsplash.jpg',
|
| 381 |
+
0.2, 3.5, 42, 5.0, 0.8
|
| 382 |
],
|
| 383 |
]
|
| 384 |
+
gr.Examples(examples=example_inps, inputs=[prompt, id_image, id_weight, guidance, seed, true_cfg, eta])
|
| 385 |
|
| 386 |
generate_btn.click(
|
| 387 |
fn=generate_image,
|
example_inputs/unsplash/marcin-sajur-nZdMgqvYPBY-unsplash.jpg
ADDED
|
Git LFS Details
|