Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
Lucius338 opened this issue Aug 20, 2023 · 3 comments
Closed
1 task done

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

Lucius338 opened this issue Aug 20, 2023 · 3 comments
Labels
extension Extension is not working correctly upstream Fix is required in upstream library

Comments

@Lucius338
Copy link

Lucius338 commented Aug 20, 2023

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: 8d97b35 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

mcmonkeyprojects/sd-dynamic-thresholding#63

Acknowledgements

  • I have read the above and searched for existing issues
@Lucius338 Lucius338 added the extension Extension is not working correctly label Aug 20, 2023
@Lucius338 Lucius338 changed the title [Extension]: Dynamic Thresholding RUNTIME ERROR [Extension]: Dynamic Thresholding - Secondary Sampler RUNTIME ERROR Aug 20, 2023
@Lucius338
Copy link
Author

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
Copy link
Owner

couple of clarifications:

  • sdnext uses "default" as default sampler (both primary and secondary) which means whatever is set as default in loaded model. it doesn't mean that sdnext sets plms, it means that whatever model you loaded had plms as its default sampler. a1111 does not have a concept of default at all.
  • dynamic thesholding extension exlcludes ddim, plms and unipc as valid samplers as it incorrectly believes that they are not supported for img2img operations. that was the case months ago, but unipc is nowadays fully supported and should be allowed.
  • dynamic thresholding extension looks at latent sampler (secondary sampler), because internally its working as img2img, just like hires fix. should that be documented by extension? for sure
  • extension raises "runtime error" which is really bad behavior - it should report error nicely and implement a fallback to primary sampler.

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 vladmandic added the upstream Fix is required in upstream library label Aug 21, 2023
@vladmandic
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension Extension is not working correctly upstream Fix is required in upstream library
Projects
None yet
Development

No branches or pull requests

2 participants