Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tim9292654 opened this issue Aug 8, 2023 · 2 comments

Comments

@tim9292654
Copy link

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
Copy link

Ketorami commented Aug 9, 2023

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 added a commit that referenced this issue Aug 10, 2023
@hako-mikan
Copy link
Owner

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants