Skip to content

Commit

Permalink
fix SD.Next compatible issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wkpark committed Feb 2, 2024
1 parent bdd3906 commit 225f937
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/ddetailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2340,7 +2340,7 @@ def on_app_started(demo, app):
dependency = None

for d in dependencies:
if "js" in d and d["js"] in [ "submit", "submit_img2img" ]:
if "js" in d and d["js"] in [ "submit", "submit_img2img", "submit_txt2img" ]:
dependency = d

params = [params for params in demo.fns if compare_components_with_ids(params.inputs, dependency["inputs"])]
Expand Down Expand Up @@ -2989,7 +2989,7 @@ def _controlnet_params(p, params):

# get img2img sampler steps and update total tqdm
_, sampler_steps = sd_samplers_common.setup_img2img_steps(p)
if len(gen_selected) > 0 and shared.total_tqdm._tqdm is not None:
if len(gen_selected) > 0 and getattr(shared.total_tqdm, "_tqdm", None) is not None:
shared.total_tqdm.updateTotal(shared.total_tqdm._tqdm.total + (sampler_steps + 1) * len(gen_selected))

self.cn_hijack_undo(p2)
Expand Down Expand Up @@ -3079,7 +3079,7 @@ def _controlnet_params(p, params):

# get img2img sampler steps and update total tqdm
_, sampler_steps = sd_samplers_common.setup_img2img_steps(p)
if len(gen_selected) > 0 and shared.total_tqdm._tqdm is not None:
if len(gen_selected) > 0 and getattr(shared.total_tqdm, "_tqdm", None) is not None:
shared.total_tqdm.updateTotal(shared.total_tqdm._tqdm.total + (sampler_steps + 1) * len(gen_selected))

self.cn_hijack_undo(p)
Expand Down

0 comments on commit 225f937

Please sign in to comment.