[GH-ISSUE #308] YAML file misinterpreted as wildcard (TypeError: list indices must be integers or slices, not dict) #215

Closed
opened 2026-10-30 21:21:08 +00:00 by bsakaguchi · 5 comments
Owner

Originally created by @faustoserone on GitHub (Nov 2, 2024).
Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/308

Hi,
I haven't used A1111 for a couple of months.
Today I updated it and I got the following error:

*** Error loading script: tag_autocomplete_helper.py
Traceback (most recent call last):
File "G:\stable-diffusion-webui\modules\scripts.py", line 515, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "G:\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 535, in
write_temp_files()
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 505, in write_temp_files
get_yaml_wildcards()
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 180, in get_yaml_wildcards
if (is_umi_format(data)):
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 137, in is_umi_format
if not (data[item] and 'Tags' in data[item] and isinstance(data[item]['Tags'], list)):
TypeError: list indices must be integers or slices, not dict

can you help me please? thank you.

Originally created by @faustoserone on GitHub (Nov 2, 2024). Original GitHub issue: https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/308 Hi, I haven't used A1111 for a couple of months. Today I updated it and I got the following error: *** Error loading script: tag_autocomplete_helper.py Traceback (most recent call last): File "G:\stable-diffusion-webui\modules\scripts.py", line 515, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "G:\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module module_spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 535, in <module> write_temp_files() File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 505, in write_temp_files get_yaml_wildcards() File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 180, in get_yaml_wildcards if (is_umi_format(data)): File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 137, in is_umi_format if not (data[item] and 'Tags' in data[item] and isinstance(data[item]['Tags'], list)): TypeError: list indices must be integers or slices, not dict can you help me please? thank you.
bsakaguchi 2026-10-30 21:21:08 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@DominikDoom commented on GitHub (Nov 2, 2024):

It seems you have a YAML file somewhere that TAC thinks is a specific format of wildcard list but fails to parse it as such (likely located in another extension). Normally it should already ignore errors that happen there, but it seems this failed for your affected file. I pushed a probable fix that should catch this error as well, can you please update the extension and tell me if it helped you?

<!-- gh-comment-id:2452981603 --> @DominikDoom commented on GitHub (Nov 2, 2024): It seems you have a YAML file somewhere that TAC thinks is a specific format of wildcard list but fails to parse it as such (likely located in another extension). Normally it should already ignore errors that happen there, but it seems this failed for your affected file. I pushed a probable fix that should catch this error as well, can you please update the extension and tell me if it helped you?
Author
Owner

@faustoserone commented on GitHub (Nov 2, 2024):

unfortunately it doesn't work, but it seems to have changed the error report slightly:

*** Error loading script: tag_autocomplete_helper.py
Traceback (most recent call last):
File "G:\stable-diffusion-webui\modules\scripts.py", line 515, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "G:\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 539, in
write_temp_files()
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 509, in write_temp_files
get_yaml_wildcards()
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 187, in get_yaml_wildcards
parse_dynamic_prompt_format(yaml_wildcards, data, path)
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 163, in parse_dynamic_prompt_format
recurse_dict(data)
File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 157, in recurse_dict
for key, value in d.copy().items():
AttributeError: 'list' object has no attribute 'items'

<!-- gh-comment-id:2453012991 --> @faustoserone commented on GitHub (Nov 2, 2024): unfortunately it doesn't work, but it seems to have changed the error report slightly: *** Error loading script: tag_autocomplete_helper.py Traceback (most recent call last): File "G:\stable-diffusion-webui\modules\scripts.py", line 515, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "G:\stable-diffusion-webui\modules\script_loading.py", line 13, in load_module module_spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 539, in <module> write_temp_files() File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 509, in write_temp_files get_yaml_wildcards() File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 187, in get_yaml_wildcards parse_dynamic_prompt_format(yaml_wildcards, data, path) File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 163, in parse_dynamic_prompt_format recurse_dict(data) File "G:\stable-diffusion-webui\extensions\a1111-sd-webui-tagcomplete\scripts\tag_autocomplete_helper.py", line 157, in recurse_dict for key, value in d.copy().items(): AttributeError: 'list' object has no attribute 'items'
Author
Owner

@faustoserone commented on GitHub (Nov 2, 2024):

I removed all the YAML files and it works.

<!-- gh-comment-id:2453014410 --> @faustoserone commented on GitHub (Nov 2, 2024): I removed all the YAML files and it works.
Author
Owner

@DominikDoom commented on GitHub (Nov 2, 2024):

Ah I see, now it's the other YAML format that breaks. I pushed another fix, that should really cover all YAML file problems.
You can put the files back and it should log which file was the issue now.

<!-- gh-comment-id:2453014700 --> @DominikDoom commented on GitHub (Nov 2, 2024): Ah I see, now it's the other YAML format that breaks. I pushed another fix, that should really cover all YAML file problems. You can put the files back and it should log which file was the issue now.
Author
Owner

@faustoserone commented on GitHub (Nov 2, 2024):

No error log. Now it works! Thank you very much <3

<!-- gh-comment-id:2453015993 --> @faustoserone commented on GitHub (Nov 2, 2024): No error log. Now it works! Thank you very much <3
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DominikDoom/a1111-sd-webui-tagcomplete#215
No description provided.