Skip to content

Commit

Permalink
Some Fixes for update to gradio 3.34.0 (nod-ai#1538)
Browse files Browse the repository at this point in the history
* Fixes randomize seed buttons that stopped working.
* Update now deprecated method to set initial colums for output
gallery to the newer undeprecated one.
  • Loading branch information
one-lithe-rune authored Jun 15, 2023
1 parent a5c882f commit 38570a9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions apps/stable_diffusion/web/ui/img2img_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,10 @@ def create_canvas(w, h):
with gr.Column(scale=2):
random_seed = gr.Button("Randomize Seed")
random_seed.click(
None,
lambda: -1,
inputs=[],
outputs=[seed],
_js="() => -1",
queue=False,
)
with gr.Column(scale=6):
stable_diffusion = gr.Button("Generate Image(s)")
Expand Down
4 changes: 2 additions & 2 deletions apps/stable_diffusion/web/ui/inpaint_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,10 @@ def inpaint_api(
with gr.Column(scale=2):
random_seed = gr.Button("Randomize Seed")
random_seed.click(
None,
lambda: -1,
inputs=[],
outputs=[seed],
_js="() => -1",
queue=False,
)
with gr.Column(scale=6):
stable_diffusion = gr.Button("Generate Image(s)")
Expand Down
4 changes: 2 additions & 2 deletions apps/stable_diffusion/web/ui/lora_train_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@
with gr.Column(scale=2):
random_seed = gr.Button("Randomize Seed")
random_seed.click(
None,
lambda: -1,
inputs=[],
outputs=[seed],
_js="() => -1",
queue=False,
)
with gr.Column(scale=6):
train_lora = gr.Button("Train LoRA")
Expand Down
4 changes: 2 additions & 2 deletions apps/stable_diffusion/web/ui/outpaint_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@ def outpaint_api(
with gr.Column(scale=2):
random_seed = gr.Button("Randomize Seed")
random_seed.click(
None,
lambda: -1,
inputs=[],
outputs=[seed],
_js="() => -1",
queue=False,
)
with gr.Column(scale=6):
stable_diffusion = gr.Button("Generate Image(s)")
Expand Down
2 changes: 1 addition & 1 deletion apps/stable_diffusion/web/ui/outputgallery_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def clear_zero_length_temps():
value=gallery_files.value,
visible=False,
show_label=True,
).style(grid=4)
).style(columns=4)
gallery.DEFAULT_TEMP_DIR = gradio_tmp_galleries_folder

with gr.Column(scale=4):
Expand Down
4 changes: 2 additions & 2 deletions apps/stable_diffusion/web/ui/txt2img_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ def txt2img_api(
with gr.Column(scale=2):
random_seed = gr.Button("Randomize Seed")
random_seed.click(
None,
lambda: -1,
inputs=[],
outputs=[seed],
_js="() => -1",
queue=False,
)
with gr.Column(scale=6):
stable_diffusion = gr.Button("Generate Image(s)")
Expand Down
4 changes: 2 additions & 2 deletions apps/stable_diffusion/web/ui/upscaler_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,10 @@ def upscaler_api(
with gr.Column(scale=2):
random_seed = gr.Button("Randomize Seed")
random_seed.click(
None,
lambda: -1,
inputs=[],
outputs=[seed],
_js="() => -1",
queue=False,
)
with gr.Column(scale=6):
stable_diffusion = gr.Button("Generate Image(s)")
Expand Down

0 comments on commit 38570a9

Please sign in to comment.