Skip to content

[Bug]: TypeError: 'NoneType' object is not iterable #332

Description

@Mr-ex777

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
  • 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?

Moments ago I was trying to generate I get TypeError: 'NoneType' object is not iterable. Restarted and it did pretty much the exact same thing. Did not update anything at all, things are generating normally until this is reported.

Clean installation of webuii does nothing

Also can seemingly generate some other prompts, if the prompt cannot be done for whatever reason, it issues the word "error" on top of the word count

Steps to reproduce the problem

  1. Click generate
  2. Use exactly the prompt below stated on the console logs (NSFW)
  3. TypeError: 'NoneType' object is not iterable

What should have happened?

Generate like usual

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

sysinfo-2025-03-22-09-09.json

Console logs

venv "C:\stable-diffusion-webui-reForge\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: f1.3.0-v1.10.1RC-latest-1037-g525b1f51
Commit hash: 525b1f51a4e26c1f7415b04bf6ef3dbeaf168035
Launching Web UI with arguments: --theme dark --cuda-stream --pin-shared-memory
Total VRAM 8188 MB, total RAM 32581 MB
Set vram state to: NORMAL_VRAM
Always pin shared GPU memory
Device: cuda:0 NVIDIA GeForce RTX 4060 : native
Hint: your device supports --cuda-malloc for a bit less vram usage and small speed improvement
VAE dtype: torch.bfloat16
CUDA Stream Activated:  True
Using pytorch attention
ControlNet preprocessor location: C:\stable-diffusion-webui-reForge\models\ControlNetPreprocessor
C:\stable-diffusion-webui-reForge\venv\lib\site-packages\diffusers\models\transformers\transformer_2d.py:34: FutureWarning: `Transformer2DModelOutput` is deprecated and will be removed in version 1.0.0. Importing `Transformer2DModelOutput` from `diffusers.models.transformer_2d` is deprecated and this will be removed in a future version. Please use `from diffusers.models.modeling_outputs import Transformer2DModelOutput`, instead.
  deprecate("Transformer2DModelOutput", "1.0.0", deprecation_message)
[-] ADetailer initialized. version: 24.11.1, num models: 13
[ForgeCouple] - INFO - Loaded Adv. Presets...
Memory change: 1.25 MB (0.80 GB total)
Loading model luminarqmixVpredNoobaixl_v11.safetensors [9e7accdcda] (1 of 1)
Loading weights [9e7accdcda] from C:\stable-diffusion-webui-reForge\models\Stable-diffusion\luminarqmixVpredNoobaixl_v11.safetensors
2025-03-22 17:06:13,691 - ControlNet - INFO - ControlNet UI callback registered.
Running on local URL:  http://127.0.0.1:7860
model_type V_PREDICTION
UNet ADM Dimension 2816

To create a public link, set `share=True` in `launch()`.
Startup time: 16.3s (prepare environment: 3.6s, import torch: 5.5s, import gradio: 0.7s, setup paths: 1.0s, initialize shared: 0.3s, other imports: 0.3s, load scripts: 3.4s, create ui: 0.9s, gradio launch: 0.5s).
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.text_projection', 'cond_stage_model.clip_l.logit_scale'}
left over keys: dict_keys(['v_pred', 'cond_stage_model.clip_l.transformer.text_model.embeddings.position_ids'])
Loading VAE weights specified in settings: C:\stable-diffusion-webui-reForge\models\VAE\sdxl_vae.safetensors
Begin to load 1 model
[Memory Management] Current Free GPU Memory (MB) = 7087.00
[Memory Management] Model Memory (MB) = 2144.35
[Memory Management] Minimal Inference Memory (MB) = 1024.00
[Memory Management] Estimated Remaining GPU Memory (MB) = 3918.64
Moving model(s) has taken 0.52 seconds
Model luminarqmixVpredNoobaixl_v11.safetensors [9e7accdcda] loaded in 9.7s (memory cleanup: 0.3s, load weights from disk: 0.7s, forge load real models: 6.9s, load VAE: 0.7s, calculate empty prompt: 0.9s).
Memory change: -324.82 MB (13.81 GB total)
[LORA] Loaded C:\stable-diffusion-webui-reForge\models\Lora\PulenKompot-Venus_Body_IL.safetensors for SDXL with 986 keys (UNet: 722, CLIP: 264) at weight 1.0
Begin to load 1 model
Reuse 1 loaded models
[Memory Management] Current Free GPU Memory (MB) = 5238.77
[Memory Management] Model Memory (MB) = 0.00
[Memory Management] Minimal Inference Memory (MB) = 1024.00
[Memory Management] Estimated Remaining GPU Memory (MB) = 4214.77
Moving model(s) has taken 1.03 seconds
No new models to load
Traceback (most recent call last):
  File "C:\stable-diffusion-webui-reForge\modules_forge\main_thread.py", line 37, in loop
    task.work()
  File "C:\stable-diffusion-webui-reForge\modules_forge\main_thread.py", line 26, in work
    self.result = self.func(*self.args, **self.kwargs)
  File "C:\stable-diffusion-webui-reForge\modules\txt2img.py", line 115, in txt2img_function
    processed = processing.process_images(p)
  File "C:\stable-diffusion-webui-reForge\modules\processing.py", line 825, in process_images
    res = process_images_inner(p)
  File "C:\stable-diffusion-webui-reForge\modules\processing.py", line 947, in process_images_inner
    p.setup_conds()
  File "C:\stable-diffusion-webui-reForge\modules\processing.py", line 1563, in setup_conds
    super().setup_conds()
  File "C:\stable-diffusion-webui-reForge\modules\processing.py", line 522, in setup_conds
    self.c = self.get_conds_with_caching(prompt_parser.get_multicond_learned_conditioning, prompts, total_steps, [self.cached_c], self.extra_network_data)
  File "C:\stable-diffusion-webui-reForge\modules\processing.py", line 505, in get_conds_with_caching
    cache[1] = function(shared.sd_model, required_prompts, steps, hires_steps, shared.opts.use_old_scheduling)
  File "C:\stable-diffusion-webui-reForge\modules\prompt_parser.py", line 261, in get_multicond_learned_conditioning
    learned_conditioning = get_learned_conditioning(model, prompt_flat_list, steps, hires_steps, use_old_scheduling)
  File "C:\stable-diffusion-webui-reForge\modules\prompt_parser.py", line 188, in get_learned_conditioning
    conds = model.get_learned_conditioning(texts)
  File "C:\stable-diffusion-webui-reForge\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:\stable-diffusion-webui-reForge\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\stable-diffusion-webui-reForge\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\stable-diffusion-webui-reForge\repositories\generative-models\sgm\modules\encoders\modules.py", line 141, in forward
    emb_out = embedder(batch[embedder.input_key])
  File "C:\stable-diffusion-webui-reForge\venv\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\stable-diffusion-webui-reForge\venv\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\stable-diffusion-webui-reForge\modules\sd_hijack_clip.py", line 313, in forward
    return super().forward(texts)
  File "C:\stable-diffusion-webui-reForge\modules\sd_hijack_clip.py", line 210, in forward
    batch_chunks, token_count = self.process_texts(texts)
  File "C:\stable-diffusion-webui-reForge\modules\sd_hijack_clip.py", line 190, in process_texts
    chunks, current_token_count = self.tokenize_line(line)
  File "C:\stable-diffusion-webui-reForge\modules\sd_hijack_clip.py", line 89, in tokenize_line
    parsed = prompt_parser.parse_prompt_attention(line)
  File "C:\stable-diffusion-webui-reForge\modules\prompt_parser.py", line 441, in parse_prompt_attention
    multiply_range(round_brackets.pop(), float(weight))
ValueError: could not convert string to float: '.1.3'
could not convert string to float: '.1.3'
*** Error completing request
*** Arguments: ('task(w5ulior7xviym2t)', <gradio.routes.Request object at 0x00000164808F74F0>, 'masterpiece, highres, absurdres, very aesthetic, newest, best quality, anime, cel shading, solo, 1girl, uncensored, nude, gotou hitori, cube hair ornament, giantess, macro, from above, crushing, destruction, dutch angle, wide shot, far away, reclining, arms at sides, arm support, crushing, destruction, pk_venusbody, (gigantic breasts:1.2), huge nipples, huge areolae, (gigantic ass:.1.3), thick thighs, wide hips, (plump:1.2), curvy, voluptuous, shaded face, worried, blush, open mouth, aroused, in heat, detailed background, tiny city, cityscape, outdoors, low clouds<lora:PulenKompot-Venus_Body_IL:1>', 'lowres, worst quality, low quality, bad anatomy, bad hands, 4koma, comic, greyscale, censored, jpeg artifacts, potted plant, text, patreon, signature, text, watermark, twitter username, bad background', [], 1, 1, 4, 768, 1280, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', 'Use same scheduler', '', '', 0, [], 0, 28, 'Euler a', 'Automatic', False, '', 0.8, -1, False, -1, 0, 0, 0, 0, False, 1, False, True, False, {'ad_model': 'face_yolov8n.pt', 'ad_model_classes': '', 'ad_tab_enable': True, 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_filter_method': 'Area', 'ad_mask_k': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_model_classes': '', 'ad_tab_enable': True, 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_filter_method': 'Area', 'ad_mask_k': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_model_classes': '', 'ad_tab_enable': True, 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_filter_method': 'Area', 'ad_mask_k': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, {'ad_model': 'None', 'ad_model_classes': '', 'ad_tab_enable': True, 'ad_prompt': '', 'ad_negative_prompt': '', 'ad_confidence': 0.3, 'ad_mask_filter_method': 'Area', 'ad_mask_k': 0, 'ad_mask_min_ratio': 0, 'ad_mask_max_ratio': 1, 'ad_x_offset': 0, 'ad_y_offset': 0, 'ad_dilate_erode': 4, 'ad_mask_merge_invert': 'None', 'ad_mask_blur': 4, 'ad_denoising_strength': 0.4, 'ad_inpaint_only_masked': True, 'ad_inpaint_only_masked_padding': 32, 'ad_use_inpaint_width_height': False, 'ad_inpaint_width': 512, 'ad_inpaint_height': 512, 'ad_use_steps': False, 'ad_steps': 28, 'ad_use_cfg_scale': False, 'ad_cfg_scale': 7, 'ad_use_checkpoint': False, 'ad_checkpoint': 'Use same checkpoint', 'ad_use_vae': False, 'ad_vae': 'Use same VAE', 'ad_use_sampler': False, 'ad_sampler': 'DPM++ 2M', 'ad_scheduler': 'Use same scheduler', 'ad_use_noise_multiplier': False, 'ad_noise_multiplier': 1, 'ad_use_clip_skip': False, 'ad_clip_skip': 1, 'ad_restore_face': False, 'ad_controlnet_model': 'None', 'ad_controlnet_module': 'None', 'ad_controlnet_weight': 1, 'ad_controlnet_guidance_start': 0, 'ad_controlnet_guidance_end': 1, 'is_api': ()}, False, True, 'Basic', '', 'Horizontal', 'None', 0.5, [[0, 0.5, 0, 1, 1], [0.5, 1, 0, 1, 1]], '{ }', False, ControlNetUnit(input_mode=<InputMode.SIMPLE: 'simple'>, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], multi_inputs_gallery=[], generated_image=None, mask_image=None, hr_option=<HiResFixOption.BOTH: 'Both'>, enabled=False, module='None', model='None', weight=1, image=None, resize_mode=<ResizeMode.INNER_FIT: 'Crop and Resize'>, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode=<ControlMode.BALANCED: 'Balanced'>, advanced_weighting=None, ipa_block_weight='', save_detected_map=True), ControlNetUnit(input_mode=<InputMode.SIMPLE: 'simple'>, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], multi_inputs_gallery=[], generated_image=None, mask_image=None, hr_option=<HiResFixOption.BOTH: 'Both'>, enabled=False, module='None', model='None', weight=1, image=None, resize_mode=<ResizeMode.INNER_FIT: 'Crop and Resize'>, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode=<ControlMode.BALANCED: 'Balanced'>, advanced_weighting=None, ipa_block_weight='', save_detected_map=True), ControlNetUnit(input_mode=<InputMode.SIMPLE: 'simple'>, use_preview_as_input=False, batch_image_dir='', batch_mask_dir='', batch_input_gallery=[], batch_mask_gallery=[], multi_inputs_gallery=[], generated_image=None, mask_image=None, hr_option=<HiResFixOption.BOTH: 'Both'>, enabled=False, module='None', model='None', weight=1, image=None, resize_mode=<ResizeMode.INNER_FIT: 'Crop and Resize'>, processor_res=-1, threshold_a=-1, threshold_b=-1, guidance_start=0, guidance_end=1, pixel_perfect=False, control_mode=<ControlMode.BALANCED: 'Balanced'>, advanced_weighting=None, ipa_block_weight='', save_detected_map=True), False, 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.5, 0.18, 15, 1, False, 5.42, 0.28, False, 'Normal', 0.7, False, 'Discrete', 'v_prediction', True, 'v_prediction', 120, 0.002, False, False, 'SDXL', '', 'Equal Weights', 832, 1216, False, 'MultiDiffusion', 768, 768, 64, 4, False, 0, 'anisotropic', 'None', False, 0, 'reinhard', 100, 0, False, 'gaussian', 'add', 0, 100, 'subtract', 0, 0, False, 127, 0, 'hard_clamp', 5, 0, False, 'None', False, False, 1536, 96, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, 0, False, False, False, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "C:\stable-diffusion-webui-reForge\modules\call_queue.py", line 74, in f
        res = list(func(*args, **kwargs))
    TypeError: 'NoneType' object is not iterable

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions