pkuliyi2015 / multidiffusion-upscaler-for-automatic1111

Tiled Diffusion and VAE optimize, licensed under CC BY-NC-SA 4.0
Other
4.69k stars 333 forks source link

[feqture request] add compatibility to Dynamic Thresholding (CFG Scale Fix) #237

Open tkittich opened 1 year ago

tkittich commented 1 year ago

Thank you for the extension. It would be great if this extension could be used with Dynamic Thresholding (CFG Scale Fix). Currently it doesn't seem to work together. I got the following error messages when using both extensions together:

MultiDiffusion hooked into 'Euler a' sampler, Tile size: 96x96, Tile batches: 4, Batch size: 8. (ext: ContrlNet)
[Tiled VAE]: input_size: torch.Size([1, 3, 2048, 3648]), tile_size: 3072, padding: 32
[Tiled VAE]: split to 1x2 = 2 tiles. Optimal tile size 1792x1984, original tile size 3072x3072
[Tiled VAE]: Executing Encoder Task Queue: 100%|███████| 182/182 [00:06<00:00, 29.35it/s]
[Tiled VAE]: Done in 7.372s, max VRAM alloc 16676.609 MB 166/182 [00:06<00:00, 43.32it/s]
11:02:13-947530 ERROR    Running script process batch:
                         D:\theera\aiart\automatic\extensions-builtin\sd-dynamic-threshold
                         ing\scripts\dynamic_thresholding.py: AttributeError
╭────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ D:\theera\aiart\automatic\modules\scripts.py:413 in process_batch                      │
│                                                                                        │
│   412 │   │   │   │   args = p.per_script_args.get(script.title(), p.script_args[scrip │
│ ❱ 413 │   │   │   │   script.process_batch(p, *args, **kwargs)                         │
│   414 │   │   │   │   s.append(f'{script.title()}:{round(time.time()-t0, 2)}s')        │
│                                                                                        │
│ D:\theera\aiart\automatic\extensions-builtin\sd-dynamic-thresholding\scripts\dynamic_t │
│ hresholding.py:127 in process_batch                                                    │
│                                                                                        │
│   126 │   │   if p.sampler is not None:                                                │
│ ❱ 127 │   │   │   p.sampler = sd_samplers.create_sampler(fixed_sampler_name, p.sd_mode │
│   128                                                                                  │
│                                                                                        │
│ D:\theera\aiart\automatic\extensions-builtin\multidiffusion-upscaler-for-automatic1111 │
│ \scripts\tilediffusion.py:373 in <lambda>                                              │
│                                                                                        │
│   372 │   │   sd_samplers.create_sampler_original_md = sd_samplers.create_sampler      │
│ ❱ 373 │   │   sd_samplers.create_sampler = lambda name, model: self.create_sampler_hij │
│   374 │   │   │   name, model, p, Method(method),                                      │
│                                                                                        │
│ D:\theera\aiart\automatic\extensions-builtin\multidiffusion-upscaler-for-automatic1111 │
│ \scripts\tilediffusion.py:445 in create_sampler_hijack                                 │
│                                                                                        │
│   444 │   │   # create a sampler with the original function                            │
│ ❱ 445 │   │   sampler = sd_samplers.create_sampler_original_md(name, model)            │
│   446 │   │   if method == Method.MULTI_DIFF: delegate_cls = MultiDiffusion            │
╰────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: module 'modules.sd_samplers' has no attribute 'create_sampler_original_md'
100%|██████████████████████████████████████████████████████| 2/2 [00:05<00:00,  2.85s/it]
[Tiled VAE]: input_size: torch.Size([1, 4, 256, 456]), tile_size: 192, padding: 1185s/it]
[Tiled VAE]: split to 2x3 = 6 tiles. Optimal tile size 160x128, original tile size 192x192
[Tiled VAE]: Executing Decoder Task Queue: 100%|███████| 738/738 [00:13<00:00, 53.13it/s]
[Tiled VAE]: Done in 15.064s, max VRAM alloc 12484.830 MB733/738 [00:13<00:00, 45.90it/s]
MultiDiffusion Sampling:  19%|█████▎                      | 3/16 [00:29<02:08,  9.86s/it]
minipuft commented 1 year ago

it was working fine until I updated it a few days ago weirdly enough, with this same error after multidiffusion tries hooking after the 50% mark.

Threnos commented 8 months ago

bump

n0kovo commented 5 months ago

+1