idrirap / ComfyUI-Lora-Auto-Trigger-Words

102 stars 7 forks source link

No Tag Found = Crash #2

Closed opensourcefan closed 8 months ago

opensourcefan commented 8 months ago

Crash results if there is no tag available for the given Lora. Not a common occurrence however it would be cool if this node could at least grab the name of the Lora and stick it in as a failsafe.

Prompt executed in 0.39 seconds got prompt calculating lora hash requesting infos No informations found. Data saved to ./loras_tags.json Prompt: headless cat drawing ERROR:root:!!! Exception during processing !!! ERROR:root:Traceback (most recent call last): File "/home/xxxxxxxx/ComfyUI/execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/xxxxxxxx/ComfyUI/execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/home/xxxxxxxx/ComfyUI/execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/home/xxxxxxxx/ComfyUI/custom_nodes/ComfyUI-Lora-Auto-Trigger-Words/nodes_utils.py", line 92, in select_tags output = parse_selector(selector, tags_list) File "/home/xxxxxxxx/ComfyUI/custom_nodes/ComfyUI-Lora-Auto-Trigger-Words/utils.py", line 180, in parse_selector output[index] = tags_list[index] IndexError: list index out of range

idrirap commented 8 months ago

The last commit should have fixed it. It should no longer crash when the tag list is empty. I also added an optional boolean for adding the lora name in the empty list outputs

opensourcefan commented 8 months ago

Works excellent, thanks for the rapid fix and tweak.