hako-mikan / sd-webui-cd-tuner

Color/Detail control for Stable Diffusion web-ui
GNU Affero General Public License v3.0
205 stars 9 forks source link

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

Closed tim9292654 closed 1 year ago

tim9292654 commented 1 year ago

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 运行时抛出了一个异常。请检查疑难解答页面。

Ketorami commented 1 year ago

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

hako-mikan commented 1 year ago

Fixed.