hako-mikan/sd-webui-cd-tuner

It is basically not used, and an error is reported as soon as it is used

tim9292654 opened this issue · 2 comments

CD Tuner Effective : [0.98, 1.04, 1.0, 1.0, [0.0, 0, 0, 0]],in Hires-fix:False
*** Error executing callback cfg_denoiser_callback for D:\stable-diffusion-webui\extensions\sd-webui-cd-tuner\scripts\cdtuner.py
Traceback (most recent call last):
File "D:\stable-diffusion-webui\modules\script_callbacks.py", line 195, in cfg_denoiser_callback
c.callback(params)
File "D:\stable-diffusion-webui\extensions\sd-webui-cd-tuner\scripts\cdtuner.py", line 187, in denoiser_callback
new_weight = self.storedweights[name] + torch.tensor(ratios[i]).to(devices.device)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

Go to "stable-diffusion-webui\extensions\sd-webui-cd-tuner\scripts" and modify the file cdtuner.py

In line 187, change it to
new_weight = self.storedweights[name].to(devices.device) + torch.tensor(ratios[i]).to(devices.device)

It work for me

Fixed.