acorderob / sd-webui-prompt-postprocessor

Stable Diffusion WebUI extension to post-process the prompt, including sending content from the prompt to the negative prompt.
MIT License
21 stars 0 forks source link

[Issue] dictionary changed size during iteration error in ComfyUI #11

Closed qrrbszopgu closed 6 hours ago

qrrbszopgu commented 6 hours ago

In the latest ComfyUI I get RuntimeError: dictionary changed size during iteration around half the time it runs. The other half of the time it works.

got prompt
2024-09-29 14:28:21,733 DEBUG    [PPP] Removing wildcards from file: D:\wildcards\test.txt
!!! Exception during processing !!! dictionary changed size during iteration
Traceback (most recent call last):
  File "D:\programs\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\execution.py", line 323, in execute
    output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

  File "D:\programs\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\execution.py", line 198, in get_output_data
    return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

  File "D:\programs\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\ComfyUI-0246\utils.py", line 353, in new_func
    res_value = old_func(*final_args, **kwargs)

  File "D:\programs\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\execution.py", line 169, in _map_node_over_list
    process_inputs(input_dict, i)
  File "D:\programs\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\execution.py", line 158, in process_inputs
    results.append(getattr(obj, func)(**inputs))

  File "D:\programs\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\sd-webui-prompt-postprocessor\ppp_comfyui.py", line 395, in process
    self.wildcards_obj.refresh_wildcards(debug_level, wildcards_folders if options["process_wildcards"] else None)
  File "D:\programs\ComfyUI_windows_portable_nightly_pytorch\ComfyUI\custom_nodes\sd-webui-prompt-postprocessor\ppp_wildcards.py", line 30, in refresh_wildcards
    for fullpath in self.wildcard_files.keys():
RuntimeError: dictionary changed size during iteration

Prompt executed in 0.01 seconds
acorderob commented 6 hours ago

This happens when you remove (or rename) wildcard files because of a silly bug. I will fix it asap.

acorderob commented 6 hours ago

Fixed in 2.6.0 that i just released.

qrrbszopgu commented 6 hours ago

It works! That was fast, thank you