lllyasviel / lllyasviel/stable-diffusion-webui-forge
Read generation parameter bug.[Bug]:
- Dominant language
- Python
- Stars
- 13k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
### Checklist
- [X] The issue exists after disabling all extensions
- [X] 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
- [ ] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet
### What happened?
As soon as I drag and drop image into the webui and press "read generation parameter button" it not working anymore.
"TypeError: 'NoneType' object is not iterable"
### Steps to reproduce the problem
0.Fresh install forge Ui.
1.Press update.bat then Run.bat
2.Generate something with V51 model [working fine]
3.Download pony base model
4.Drop image showcase from this model https://civitai.com/models/405136/zonkey-realism into the webui
5.press "read generation parameter button" to copy the setting
6.press generate image
7.It will show TypeError: 'NoneType' object is not iterable
8.After that it will keep showing "TypeError: 'NoneType' object is not iterable" even after I close the console and reopen the webui to use V51 model and press generate with default setting and empty prompt.
### What should have happened?
It should generate some image.
### What browsers do you use to access the UI ?
Google Chrome
### Sysinfo
[sysinfo-2024-06-23-21-00.json](https://github.com/user-attachments/files/15946117/sysinfo-2024-06-23-21-00.json)
### Console logs
```Shell
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f0.0.17v1.8.0rc-latest-277-g0af28699
Commit hash: 0af28699c45c1c5bf9cb6818caac6ce881123131
Installing forge_legacy_preprocessor requirement: changing opencv-python version from 4.10.0.84 to 4.8.0
Installing sd-forge-controlnet requirement: changing opencv-python version from 4.10.0.84 to 4.8.0
Launching Web UI with arguments: --device-id 0
Total VRAM 8192 MB, total RAM 65409 MB
Set vram state to: NORMAL_VRAM
Device: cuda:0 NVIDIA GeForce RTX 2070 SUPER : native
Hint: your device supports --pin-shared-memory for potential speed improvements.
Hint: your device supports --cuda-malloc for potential speed improvements.
Hint: your device supports --cuda-stream for potential speed improvements.
VAE dtype: torch.float32
CUDA Stream Activated: False
Using pytorch cross attention
ControlNet preprocessor location: C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\models\ControlNetPreprocessor
Loading weights [15012c538f] from C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\models\Stable-diffusion\realisticVisionV51_v51VAE.safetensors
2024-06-24 03:50:03,779 - ControlNet - INFO - ControlNet UI callback registered.
Running on local URL: http://127.0.0.1:7860
model_type EPS
UNet ADM Dimension 0
To create a public link, set `share=True` in `launch()`.
Startup time: 22.5s (prepare environment: 9.7s, import torch: 5.1s, import gradio: 1.0s, setup paths: 1.1s, initialize shared: 0.2s, other imports: 0.7s, load scripts: 3.2s, create ui: 0.7s, gradio launch: 0.8s).
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection'}
To load target model SD1ClipModel
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) = 7122.9990234375
[Memory Management] Model Memory (MB) = 454.2076225280762
[Memory Management] Minimal Inference Memory (MB) = 1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) = 5644.791400909424
Moving model(s) has taken 0.37 seconds
Model loaded in 4.8s (load weights from disk: 1.0s, forge load real models: 3.1s, calculate empty prompt: 0.6s).
To load target model BaseModel
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) = 6772.322265625
[Memory Management] Model Memory (MB) = 1639.4137649536133
[Memory Management] Minimal Inference Memory (MB) = 1024.0
[Memory Management] Estimated Remaining GPU Memory (MB) = 4108.908500671387
Moving model(s) has taken 0.60 seconds
Traceback (most recent call last):
File "C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\modules_forge\main_thread.py", line 37, in loop
task.work()
File "C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\modules_forge\main_thread.py", line 26, in work
self.result = self.func(*self.args, **self.kwargs)
File "C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\modules\txt2img.py", line 111, in txt2img_function
processed = processing.process_images(p)
File "C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\modules\processing.py", line 752, in process_images
res = process_images_inner(p)
File "C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\modules\processing.py", line 922, in process_images_inner
samples_ddim = p.sample(conditioning=p.c, unconditional_conditioning=p.uc, seeds=p.seeds, subseeds=p.subseeds, subseed_strength=p.subseed_strength, prompts=p.prompts)
File "C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\modules\processing.py", line 1275, in sample
samples = self.sampler.sample(self, x, conditioning, unconditional_conditioning, image_conditioning=self.txt2img_image_conditioning(x))
File "C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\modules\sd_samplers_kdiffusion.py", line 214, in sample
sigmas = self.get_sigmas(p, steps).to(x.device)
File "C:\Users\PC\Desktop\webui_forge_cu121_torch21\webui\modules\sd_samplers_kdiffusion.py", line 111, in get_sigmas
sigmas_func = k_diffusion_scheduler[opts.k_sched_type]
KeyError: 'Exponential'
'Exponential'
*** Error completing request
*** Arguments: ('task(5etu961v6ngvzs0)', , '', '', [], 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\PC\Desktop\webui_forge_cu121_torch21\webui\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
Research direction
Start by reproducing the failure after using the read-generation-parameter button, then inspect modules/sd_samplers_kdiffusion.py around get_sigmas and the k_diffusion_scheduler lookup. Trace how the 'Exponential' value reaches opts.k_sched_type; done means generation no longer raises KeyError or the follow-up NoneType error with the reported workflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100