lllyasviel / lllyasviel/stable-diffusion-webui-forge

[Bug]: RuntimeError: Please register a generator to the PrivateUse1 dispatch key, using the REGISTER_GENERATOR_PRIVATEUSE1 macro.

Open
#810 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [ ] The issue exists after disabling all extensions
- [ ] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [X] The issue exists in the current version of the webui
- [X] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

txt2image is not working in any way

### Steps to reproduce the problem

Launching Web UI with arguments: --always-gpu --directml --skip-torch-cuda-test --gradio-allowed-path C:\Users\1\StabilityMatrix\Data\Images

### What should have happened?

should generate the image

### What browsers do you use to access the UI ?

Google Chrome

### Sysinfo

Windows 11
RX 6600M
R5 5500

### Console logs

```Shell
Traceback (most recent call last):
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules_forge\main_thread.py", line 37, in loop
task.work()
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules_forge\main_thread.py", line 26, in work
self.result = self.func(*self.args, **self.kwargs)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\txt2img.py", line 111, in txt2img_function
processed = processing.process_images(p)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\processing.py", line 741, in process_images
sd_models.reload_model_weights()
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\sd_models.py", line 628, in reload_model_weights
return load_model(info)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\sd_models.py", line 614, in load_model
sd_model.cond_stage_model_empty_prompt = get_empty_cond(sd_model)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\sd_models.py", line 536, in get_empty_cond
d = sd_model.get_learned_conditioning([""])
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\sd_models_xl.py", line 37, in get_learned_conditioning
c = self.conditioner(sdxl_conds, force_zero_embeddings=['txt'] if force_zero_negative_prompt else [])
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\torch\nn\modules\module.py", line 1511, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\venv\lib\site-packages\torch\nn\modules\module.py", line 1520, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\repositories\generative-models\sgm\modules\encoders\modules.py", line 168, in forward
output[out_key] = torch.cat(
RuntimeError: tensor.device().type() == at::DeviceType::PrivateUse1 INTERNAL ASSERT FAILED at "C:\\__w\\1\\s\\pytorch-directml-plugin\\torch_directml\\csrc\\dml\\DMLTensor.cpp":31, please report a bug to PyTorch. unbox expects Dml at::Tensor as inputs
tensor.device().type() == at::DeviceType::PrivateUse1 INTERNAL ASSERT FAILED at "C:\\__w\\1\\s\\pytorch-directml-plugin\\torch_directml\\csrc\\dml\\DMLTensor.cpp":31, please report a bug to PyTorch. unbox expects Dml at::Tensor as inputs
*** Error completing request
*** Arguments: ('task(6uzu48goupxp1zj)', , 'sky', '', [], 20, 'DPM++ 2M Karras', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], 0, False, '', 0.8, -1, False, -1, 0, 0, 0, ControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), ControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), ControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), False, 7, 1, 'Constant', 0, 'Constant', 0, 1, 'enable', 'MEAN', 'AD', 1, False, 1.01, 1.02, 0.99, 0.95, False, 0.5, 2, False, 256, 2, 0, False, False, 3, 2, 0, 0.35, True, 'bicubic', 'bicubic', False, 0, 'anisotropic', 0, 'reinhard', 100, 0, 'subtract', 0, 0, 'gaussian', 'add', 0, 100, 127, 0, 'hard_clamp', 5, 0, 'None', 'None', False, 'MultiDiffusion', 768, 768, 64, 4, False, False, False, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {}
Traceback (most recent call last):
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
TypeError: 'NoneType' object is not iterable

---
Traceback (most recent call last):
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules_forge\main_thread.py", line 37, in loop
task.work()
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules_forge\main_thread.py", line 26, in work
self.result = self.func(*self.args, **self.kwargs)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\txt2img.py", line 111, in txt2img_function
processed = processing.process_images(p)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\processing.py", line 752, in process_images
res = process_images_inner(p)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\processing.py", line 848, in process_images_inner
p.rng = rng.ImageRNG((opt_C, p.height // opt_f, p.width // opt_f), p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, seed_resize_from_h=p.seed_resize_from_h, seed_resize_from_w=p.seed_resize_from_w)
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\rng.py", line 114, in __init__
self.generators = [create_generator(seed) for seed in seeds]
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\rng.py", line 114, in
self.generators = [create_generator(seed) for seed in seeds]
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\rng.py", line 86, in create_generator
generator = torch.Generator(device).manual_seed(int(seed))
RuntimeError: Please register a generator to the PrivateUse1 dispatch key, using the REGISTER_GENERATOR_PRIVATEUSE1 macro.
Please register a generator to the PrivateUse1 dispatch key, using the REGISTER_GENERATOR_PRIVATEUSE1 macro.
*** Error completing request
*** Arguments: ('task(oplgumwajod6qpt)', , 'sky', '', [], 20, 'Euler', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], 0, True, 'artUniverse_sdxlV20.safetensors [716a6de0f8]', 0.8, -1, False, -1, 0, 0, 0, ControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), ControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), ControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], generated_image=None, mask_image=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode='Balanced', save_detected_map=True), False, 7, 1, 'Constant', 0, 'Constant', 0, 1, 'enable', 'MEAN', 'AD', 1, False, 1.01, 1.02, 0.99, 0.95, False, 0.5, 2, False, 256, 2, 0, False, False, 3, 2, 0, 0.35, True, 'bicubic', 'bicubic', False, 0, 'anisotropic', 0, 'reinhard', 100, 0, 'subtract', 0, 0, 'gaussian', 'add', 0, 100, 127, 0, 'hard_clamp', 5, 0, 'None', 'None', False, 'MultiDiffusion', 768, 768, 64, 4, False, False, False, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, False, False, False, 0, False) {}
Traceback (most recent call last):
File "C:\Users\1\StabilityMatrix\Data\Packages\stable-diffusion-webui-forge\modules\call_queue.py", line 57, in f
res = list(func(*args, **kwargs))
TypeError: 'NoneType' object is not iterable
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the reported Windows 11, RX 6600M, --directml launch arguments, and clean-install checklist. Trace the two paths named in modules/rng.py and modules_forge/main_thread.py, then inspect the conditioning path in modules/sd_models.py and repositories/generative-models/sgm/modules/encoders/modules.py. Done means txt2image generates an image without either reported RuntimeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.