lllyasviel / lllyasviel/stable-diffusion-webui-forge

跑图时一旦有一条边长超过936就会报错TypeError: 'NoneType' object is not iterable

Open
#903 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

之前没有这个情况,不确定是哪次更新后的问题。
完整报错代码如下
Traceback (most recent call last):
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules_forge\main_thread.py", line 37, in loop
task.work()
File "C:\Users\Desktop\pycharm\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\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules\txt2img.py", line 110, in txt2img_function
processed = processing.process_images(p)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules\processing.py", line 820, in process_images
res = process_images_inner(p)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules\processing.py", line 990, in process_images_inner
x_samples_ddim = decode_latent_batch(p.sd_model, samples_ddim, target_device=devices.cpu, check_for_nans=True)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules\processing.py", line 642, in decode_latent_batch
samples_pytorch = decode_first_stage(model, batch).to(target_device)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules\sd_samplers_common.py", line 74, in decode_first_stage
return samples_to_images_tensor(x, approx_index, model)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules\sd_samplers_common.py", line 57, in samples_to_images_tensor
x_sample = model.decode_first_stage(sample)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules_forge\forge_loader.py", line 244, in patched_decode_first_stage
sample = sd_model.forge_objects.vae.decode(sample).movedim(-1, 1) * 2.0 - 1.0
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\ldm_patched\modules\sd.py", line 263, in decode
return self.decode_inner(samples_in)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\ldm_patched\modules\sd.py", line 252, in decode_inner
pixel_samples[x:x+batch_number] = torch.clamp((self.first_stage_model.decode(samples).to(self.output_device).float() + 1.0) / 2.0, min=0.0, max=1.0)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\backend\vae.py", line 24, in decode
return super().decode(x).sample
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\system\python\lib\site-packages\diffusers\utils\accelerate_utils.py", line 46, in wrapper
return method(self, *args, **kwargs)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\system\python\lib\site-packages\diffusers\models\autoencoders\autoencoder_kl.py", line 314, in decode
decoded = self._decode(z).sample
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\system\python\lib\site-packages\diffusers\models\autoencoders\autoencoder_kl.py", line 285, in _decode
dec = self.decoder(z)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\extensions\multidiffusion-upscaler-for-automatic1111-main\scripts\tilevae.py", line 381, in __call__
return self.vae_tile_forward(x)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\extensions\multidiffusion-upscaler-for-automatic1111-main\scripts\tilevae.py", line 268, in wrapper
ret = fn(*args, **kwargs)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\extensions\multidiffusion-upscaler-for-automatic1111-main\scripts\tilevae.py", line 535, in vae_tile_forward
single_task_queue = build_task_queue(net, is_decoder)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\extensions\multidiffusion-upscaler-for-automatic1111-main\scripts\tilevae.py", line 181, in build_task_queue
build_sampling(task_queue, net, is_decoder)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\webui\extensions\multidiffusion-upscaler-for-automatic1111-main\scripts\tilevae.py", line 142, in build_sampling
resblock2task(task_queue, net.mid.block_1)
File "C:\Users\Desktop\pycharm\webui_forge_cu121_torch21\system\python\lib\site-packages\torch\nn\modules\module.py", line 1695, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'Decoder' object has no attribute 'mid'
'Decoder' object has no attribute 'mid'
*** Error completing request
*** Arguments: ('task(p5rsho8wfyap4km)', , 'Shadow of details,floor,(simple,2d),bed room,a mordern room Scenes from an empty house,wall,[glass door],[Bookcase],[Indoor landscape plants],Water dispenser, masterpiece, best quality,[blue walls],wooden floor,(from below),[gray]\n\n\n', '(window:1.2),(bright:1.2)(black line:1.3),(from below),(water:1.2),(black line Stroke:1.1) anime background,nobody,EasyNegativeV2, bad anatomy, bad hands, (worst_quality, low_quality:1.3),(TV:1.3),(bed:1.3)', [], 1, 1, 7, 512, 984, False, 0.55, 2, '4x-AnimeSharp', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', None, 0, 20, 'Euler a', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, False, 'MultiDiffusion', False, True, 1024, 1024, 96, 96, 48, 4, 'None', 2, False, 10, 1, 1, 64, False, False, False, False, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1, False, 0.4, 0.4, 0.2, 0.2, '', '', 'Background', 0.2, -1, True, 1536, 96, True, True, True, False, ControlNetUnit(input_mode=, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=None, batch_mask_gallery=None, generated_image=None, mask_image=None, mask_image_fg=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, image_fg=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0.0, guidance_end=1.0, 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=None, batch_mask_gallery=None, generated_image=None, mask_image=None, mask_image_fg=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, image_fg=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0.0, guidance_end=1.0, 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=None, batch_mask_gallery=None, generated_image=None, mask_image=None, mask_image_fg=None, hr_option='Both', enabled=False, module='None', model='None', weight=1, image=None, image_fg=None, resize_mode='Crop and Resize', processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0.0, guidance_end=1.0, 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, 3, 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\Desktop\pycharm\webui_forge_cu121_torch21\webui\modules\call_queue.py", line 74, in f
res = list(func(*args, **kwargs))
TypeError: 'NoneType' object is not iterable

---

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce with the 512x984 generation settings shown in the report and trace the decode path through modules/processing.py, modules/sd_samplers_common.py, modules_forge/forge_loader.py, and extensions/multidiffusion-upscaler-for-automatic1111-main/scripts/tilevae.py. Start at build_task_queue() and the Decoder.mid access in build_sampling(); done means generation no longer fails for an image edge longer than 936.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.