vladmandic / automatic

SD.Next: Advanced Implementation of Stable Diffusion and other Diffusion-based generative image models
https://github.com/vladmandic/automatic
GNU Affero General Public License v3.0
5.64k stars 415 forks source link

[Extension]: Dynamic Thresholding - Secondary Sampler RUNTIME ERROR #2050

Closed Lucius338 closed 7 months ago

Lucius338 commented 1 year ago

Issue Description

Clean install of the Vladmandic fork installed today, but for some reason I cannot get dynamic thresholding to work for the life of me. Using SD1.5 models in fp32 with the original backend. Tried disabling all extensions, including Controlnet, no dice. I think it has to do with PLMS being set as the default sampler in this fork, and I can't find a way to change it in the config file. At first, I received the same error but it said "Cannot use secondary sampler DDIM with Dynamic Thresholding." Once I removed the DDIM sampler from the list, it switched to PLMS. Is one of the optimizations or another setting responsible for assigning a secondary sampler? This one's got me baffled.

16:44:43-323693 ERROR Running script process batch: C:\sdnext082023\extensions-builtin\sd-dynamic-thresholding\scripts\dynamic_thresholding.py: RuntimeError ┌───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────┐ │ C:\sdnext082023\modules\scripts.py:451 in process_batch │ │ │ │ 450 │ │ │ │ args = p.per_script_args.get(script.title(), p.script_args[script.args_f │ │ > 451 │ │ │ │ script.process_batch(p, *args, **kwargs) │ │ 452 │ │ │ │ s.append(f'{script.title()}:{round(time.time()-t0, 2)}s') │ │ │ │ C:\sdnext082023\extensions-builtin\sd-dynamic-thresholding\scripts\dynamic_thresholding.py:99 in process_batch │ │ │ │ 98 │ │ if orig_latent_sampler_name in ["DDIM", "PLMS"]: │ │ > 99 │ │ │ raise RuntimeError(f"Cannot use secondary sampler {orig_latent_sampler_name} │ │ 100 │ │ if 'UniPC' in (orig_sampler_name, orig_latent_sampler_name) and p.enable_hr: │ └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ RuntimeError: Cannot use secondary sampler PLMS with Dynamic Thresholding

Version Platform Description

16:07:06-987337 INFO Python 3.10.6 on Windows 16:07:07-039384 INFO Version: 8d97b358 Sun Aug 20 15:51:14 2023 +0200 16:07:07-084425 INFO nVidia CUDA toolkit detected

Windows 10, Geforce RTX 3070 TI, Opera GX

URL link of the extension

https://github.com/mcmonkeyprojects/sd-dynamic-thresholding

URL link of the issue reported in the extension repository

https://github.com/mcmonkeyprojects/sd-dynamic-thresholding/issues/63

Acknowledgements

Lucius338 commented 1 year ago

OKAY, I found the source of the error. I didn't even think about second pass because I hadn't been using it, but even with Second Pass disabled, if its sampler is set to default, it's enough to trip up Dynamic Thresholding. The workaround for now is manually changing the second pass sampler even if you're not using it. Should I close this topic or should there be a solution implemented for this?

vladmandic commented 1 year ago

couple of clarifications:

all-in-all, yes, there are several improvements that should be made, but pretty much all are on extension side. i'll update extension issue you've created.

vladmandic commented 7 months ago

closing here as issue was reported upstream 6 months ago without any progress - it would be a nearly-trivial fix, but if author doesn't want to address it, i cannot keep the issue open here.