mcmonkeyprojects / sd-dynamic-thresholding

Dynamic Thresholding (CFG Scale Fix) for Stable Diffusion (SwarmUI, ComfyUI, and Auto WebUI)
MIT License
1.14k stars 111 forks source link

not working with UniPC on webui 1.6.0 #80

Open AG-w opened 1 year ago

AG-w commented 1 year ago
    Traceback (most recent call last):
      File "H:\AItest\stable-diffusion-webui\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "H:\AItest\stable-diffusion-webui\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "H:\AItest\stable-diffusion-webui\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
      File "H:\AItest\stable-diffusion-webui\modules\processing.py", line 732, in process_images
        res = process_images_inner(p)
      File "H:\AItest\stable-diffusion-webui\extensions\sd-webui-controlnet\scripts\batch_hijack.py", line 42, in processing_process_images_hijack
        return getattr(processing, '__controlnet_original_process_images_inner')(p, *args, **kwargs)
      File "H:\AItest\stable-diffusion-webui\modules\processing.py", line 867, in process_images_inner
        samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
      File "H:\AItest\stable-diffusion-webui\modules\processing.py", line 1137, in sample
        self.sampler = sd_samplers.create_sampler(self.sampler_name, self.sd_model)
      File "H:\AItest\stable-diffusion-webui\modules\sd_samplers.py", line 35, in create_sampler
        sampler = config.constructor(model)
      File "H:\AItest\stable-diffusion-webui\extensions\sd-dynamic-thresholding\scripts\dynamic_thresholding.py", line 149, in uniPCConstructor
        return CustomVanillaSDSampler(dynthres_unipc.CustomUniPCSampler, model, dtData)
      File "H:\AItest\stable-diffusion-webui\extensions\sd-dynamic-thresholding\scripts\dynamic_thresholding.py", line 198, in __init__
        self.sampler.main_class = dtData
    AttributeError: 'CustomVanillaSDSampler' object has no attribute 'sampler'

sd_samplers_compvis has been removed so this is no longer working https://github.com/AUTOMATIC1111/stable-diffusion-webui/commits/master/modules/sd_samplers_compvis.py

mcmonkey4eva commented 1 year ago

it looks like UniPC's handling in auto webui got completely rewritten .-.

AG-w commented 1 year ago

It seems they refactored it so it looks more like rest of k-diffusion structurely https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/modules/sd_samplers_timesteps.py https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/master/modules/sd_samplers_timesteps_impl.py