pythongosssss / ComfyUI-WD14-Tagger

A ComfyUI extension allowing for the interrogation of booru tags from images.
MIT License
436 stars 51 forks source link

Error occurred when executing WD14Tagger|pysssss #49

Open ahnjy7168 opened 2 months ago

ahnjy7168 commented 2 months ago

COmfyui

onnxruntime==1.17.3


Error occurred when executing WD14Tagger|pysssss:

list index out of range

File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 141, in recursive_execute
input_data_all = get_input_data(inputs, class_def, unique_id, outputs, prompt, extra_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ComfyUI_windows_portable\ComfyUI\execution.py", line 26, in get_input_data
obj = outputs[input_unique_id][output_index]
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^

how do i solve this?

GamingDaveUk commented 2 months ago

Exactly the same issue with almost the same setup (using show text instead of cr text list to string) Prompt executed in 0.00 seconds got prompt [rgthree] Using rgthree's optimized recursive execution. !!! Exception during processing!!! list index out of range Traceback (most recent call last): File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 141, in recursive_execute input_data_all = get_input_data(inputs, class_def, unique_id, outputs, prompt, extra_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 26, in get_input_data obj = outputs[input_unique_id][output_index]


IndexError: list index out of range
GamingDaveUk commented 2 months ago

image I even tried simplifying it as much as possible (and tried all models)

lividhen commented 2 months ago

Same issue here

MarkMiso commented 3 weeks ago

Had the same issure, on my end it was caused by only having one image in the folder.

In the "LoRA Capiton Load" node there is a condition that is triggered when only one image is present where I think they forgot to add some parameters in the returning statement.

if len(images) == 1:
    return (images[0], 1)
elif len(images) > 1:
    image1 = images[0]
    for image2 in images[1:]:
        if image1.shape[1:] != image2.shape[1:]:
            image2 = comfy.utils.common_upscale(image2.movedim(-1, 1), image1.shape[2], image1.shape[1], "bilinear", "center").movedim(1, -1)
        image1 = torch.cat((image1, image2), dim=0)

return text, path, image1, len(images)

As you can see if only one image is present the return statement returns only 2 parameters instead of 4. I've solved the issue by replacing return (images[0], 1) with return (text, path, images[0], 1) in the "LoRAcaption.py" file. You can also circumvent the issue by placing more than one image in the folder.