stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: Error Sampler in hires.fix with PLMS or UniPC?

Open LieDeath opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

If I use PLMS or UniPC Sampler with hires.fix is on, first pass is the sampler itself yes. However, after Upscale, the command line tell me the sampler change to DDIM, neither PLMS nor UniPC. Is it only a mistake on print out, or the sampler changed exactly? The BUG only exists on the 2 samplers.

Steps to reproduce the problem

  1. Change sampler to PLMS or UniPC
  2. Enable hire.fix
  3. Running, and find in the command line, before hires.fix, the sampler is right, after hires.fix, the sampler change to DDIM.

What should have happened?

The command line should tell me that before and after hires.fix, the sampler is exactly the same one in PLMS or UniPC. And the exact process is those sampler too.

Commit where the problem happens

27e319dc4f09a2f040043948e5c52965976f8491

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

--api --xformers

List of extensions

No

Console logs

Data shape for UniPC sampling is (1, 4, 104, 104)▋   | 19/20 [00:48<00:02,  2.71s/it]
Running UniPC Sampling with 21 timesteps, order 3
                                                                                                                       Running DDIM Sampling with 19 timesteps██████████████▎                                  | 19/40 [00:09<00:07,  2.83it/s]
Decoding image: 100%|██████████████████████████████████████████████████████████████████| 19/19 [01:00<00:00,  3.18s/it]
Total progress:  98%|████████████████████████████████████████████████████████████████▎ | 39/40 [01:15<00:01,  1.92s/it]
                                                                                                                       Data shape for PLMS sampling is (1, 4, 104, 104)                                                 | 0/20 [00:00<?, ?it/s]
Running PLMS Sampling with 20 timesteps
PLMS Sampler: 100%|████████████████████████████████████████████████████████████████████| 20/20 [00:07<00:00,  2.71it/s]
Running DDIM Sampling with 19 timesteps███████████████                                 | 20/40 [00:07<00:06,  2.94it/s]
Decoding image: 100%|██████████████████████████████████████████████████████████████████| 19/19 [01:00<00:00,  3.19s/it]
Total progress:  98%|████████████████████████████████████████████████████████████████▎ | 39/40 [01:13<00:01,  1.88s/it]

Additional information

No response

LieDeath avatar Mar 12 '23 03:03 LieDeath

I encountered the same problem

qingweia avatar Mar 12 '23 03:03 qingweia

UniPC for img2img (which hires fix is) is not supported yet, but apparently it is possible to do it: https://github.com/wl-zhao/UniPC/issues/6

Someone just needs to code it

ghost avatar Mar 12 '23 04:03 ghost

It worked before I pulled, now on most recent pull it broke and does this. Odd, was img2img integration reverted?

BigMeatyClaws avatar Mar 14 '23 15:03 BigMeatyClaws

UniPC for img2img (which hires fix is) is not supported yet, but apparently it is possible to do it: wl-zhao/UniPC#6

Someone just needs to code it

fyi, i gave it a shot and it was merged into vlad's fork here: https://github.com/vladmandic/automatic/pull/568

works well for me with 80 steps for low-res, then 0 (80 again) for hi-res with denoise ~0.45-0.55, and SAG scale of ~1.75.

unfortunately, i barely understand the actual math behind a lot of latent diffusion still, so it's likely a coincidence that my implementation works at all. hoping to get wl-zhao to review it someday :)

cool-bigdogs-tshirt avatar Apr 30 '23 18:04 cool-bigdogs-tshirt

Supported as of https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/8285a149d8c488ae6c7a566eb85fb5e825145464

catboxanon avatar Aug 12 '23 07:08 catboxanon