Comfy-Org / Comfy-Org/ComfyUI

privateuseone is not supported for torch.Generator()

Open
#1,707 6 comments 0 reactions 0 assignees View on GitHub
User Support
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 6h
Merged PRs (30d)
155

Description

I'm getting this error when using the defult workflow with the samplers
dpmpp_sde_gpu
dpmpp_2m_sde_gpu
dpmpp_3m_sde_gpu
the outher samplers i have tried have worked
i have a AMD Radeon RX 5700 XT 8GB memory and 16gb shared memory

> Error occurred when executing KSampler:
>
> Device type privateuseone is not supported for torch.Generator() api.
>
> File "D:\AI\ComfyUI_AMD\ComfyUI\execution.py", line 152, in recursive_execute
> output_data, output_ui = get_output_data(obj, input_data_all)
> File "D:\AI\ComfyUI_AMD\ComfyUI\execution.py", line 82, in get_output_data
> return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
> File "D:\AI\ComfyUI_AMD\ComfyUI\execution.py", line 75, in map_node_over_list
> results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
> File "D:\AI\ComfyUI_AMD\ComfyUI\nodes.py", line 1236, in sample
> return common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, negative, latent_image, denoise=denoise)
> File "D:\AI\ComfyUI_AMD\ComfyUI\nodes.py", line 1206, in common_ksampler
> samples = comfy.sample.sample(model, noise, steps, cfg, sampler_name, scheduler, positive, negative, latent_image,
> File "D:\AI\ComfyUI_AMD\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 22, in informative_sample
> raise e
> File "D:\AI\ComfyUI_AMD\ComfyUI\custom_nodes\ComfyUI-Impact-Pack\modules\impact\sample_error_enhancer.py", line 9, in informative_sample
> return original_sample(*args, **kwargs)
> File "D:\AI\ComfyUI_AMD\ComfyUI\comfy\sample.py", line 97, in sample
> samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image, start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise, denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar, seed=seed)
> File "D:\AI\ComfyUI_AMD\ComfyUI\comfy\samplers.py", line 785, in sample
> return sample(self.model, noise, positive, negative, cfg, self.device, sampler(), sigmas, self.model_options, latent_image=latent_image, denoise_mask=denoise_mask, callback=callback, disable_pbar=disable_pbar, seed=seed)
> File "D:\AI\ComfyUI_AMD\ComfyUI\comfy\samplers.py", line 690, in sample
> samples = sampler.sample(model_wrap, sigmas, extra_args, callback, noise, latent_image, denoise_mask, disable_pbar)
> File "D:\AI\ComfyUI_AMD\ComfyUI\comfy\samplers.py", line 630, in sample
> samples = getattr(k_diffusion_sampling, "sample_{}".format(sampler_name))(model_k, noise, sigmas, extra_args=extra_args, callback=k_callback, disable=disable_pbar, **extra_options)
> File "C:\Users\Drago87\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
> return func(*args, **kwargs)
> File "D:\AI\ComfyUI_AMD\ComfyUI\comfy\k_diffusion\sampling.py", line 706, in sample_dpmpp_sde_gpu
> noise_sampler = BrownianTreeNoiseSampler(x, sigma_min, sigma_max, seed=extra_args.get("seed", None), cpu=False) if noise_sampler is None else noise_sampler
> File "D:\AI\ComfyUI_AMD\ComfyUI\comfy\k_diffusion\sampling.py", line 119, in __init__
> self.tree = BatchedBrownianTree(x, t0, t1, seed, cpu=cpu)
> File "D:\AI\ComfyUI_AMD\ComfyUI\comfy\k_diffusion\sampling.py", line 85, in __init__
> self.trees = [torchsde.BrownianTree(t0, w0, t1, entropy=s, **kwargs) for s in seed]
> File "D:\AI\ComfyUI_AMD\ComfyUI\comfy\k_diffusion\sampling.py", line 85, in
> self.trees = [torchsde.BrownianTree(t0, w0, t1, entropy=s, **kwargs) for s in seed]
> File "C:\Users\Drago87\AppData\Local\Programs\Python\Python310\lib\site-packages\torchsde\_brownian\derived.py", line 155, in __init__
> self._interval = brownian_interval.BrownianInterval(t0=t0,
> File "C:\Users\Drago87\AppData\Local\Programs\Python\Python310\lib\site-packages\torchsde\_brownian\brownian_interval.py", line 554, in __init__
> W = self._randn(initial_W_seed) * math.sqrt(t1 - t0)
> File "C:\Users\Drago87\AppData\Local\Programs\Python\Python310\lib\site-packages\torchsde\_brownian\brownian_interval.py", line 248, in _randn
> return _randn(size, self._top._dtype, self._top._device, seed)
> File "C:\Users\Drago87\AppData\Local\Programs\Python\Python310\lib\site-packages\torchsde\_brownian\brownian_interval.py", line 31, in _randn
> generator = torch.Generator(device).manual_seed(int(seed))

Contributor guide

Open the contributing guide

Research direction

Start in comfy/k_diffusion/sampling.py at BrownianTreeNoiseSampler and the sample_dpmpp_sde_gpu path, then reproduce the reported samplers on the AMD privateuseone device. Inspect how torchsde creates its torch.Generator and compare the working sampler paths. Done means the listed DPM++ SDE GPU samplers run without the privateuseone Generator error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
backend, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.