Skip to content

Commit

Permalink
Copy gr.update dict (#1969)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Aug 24, 2023
1 parent 24bb7c5 commit de868ab
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/controlnet_ui/controlnet_ui_group.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import gradio as gr
import functools
from copy import copy
from typing import List, Optional, Union, Callable
import numpy as np

Expand Down Expand Up @@ -506,8 +507,8 @@ def build_sliders(module, pp):
visible=not pp,
interactive=not pp,
),
clear_slider_update,
clear_slider_update,
copy(clear_slider_update),
copy(clear_slider_update),
gr.update(visible=True),
]
else:
Expand All @@ -530,9 +531,9 @@ def build_sliders(module, pp):
)
)
else:
grs.append(clear_slider_update)
grs.append(copy(clear_slider_update))
while len(grs) < 3:
grs.append(clear_slider_update)
grs.append(copy(clear_slider_update))
grs.append(gr.update(visible=True))
if module in model_free_preprocessors:
grs += [
Expand Down

0 comments on commit de868ab

Please sign in to comment.