LarryJane491 / Lora-Training-in-Comfy

This custom node lets you train LoRA directly in ComfyUI!
379 stars 55 forks source link

Error: cannot access local variable 'image1' where it is not associated with a value #42

Open tokenwizard opened 6 months ago

tokenwizard commented 6 months ago

I have set up my workspace to match your video tutorial. But each time I try to tag my images, it fails with the error below.

How does the path get parsed? I know the naming convention of the folder of images is particular, but the only difference I can see if your setup and mine is that you point to C:\database\5_ske and on linux, I am pointed to /run/media/tokenwizard/AI-Resources/database/5_jre

I'm just wondering if the scripts are doing some type of parsing that is dependent on the number of subfolders in the path.


Error occurred when executing LoRA Caption Load:

cannot access local variable 'image1' where it is not associated with a value

  File "/run/media/tokenwizard/AI-Stuff/ComfyUI/execution.py", line 151, in recursive_execute
    output_data, output_ui = get_output_data(obj, input_data_all)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/tokenwizard/AI-Stuff/ComfyUI/execution.py", line 81, in get_output_data
    return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/tokenwizard/AI-Stuff/ComfyUI/execution.py", line 74, in map_node_over_list
    results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/run/media/tokenwizard/AI-Stuff/ComfyUI/custom_nodes/Image-Captioning-in-ComfyUI/LoRAcaption.py", line 148, in captionload
    return text, path, image1, len(images)
                       ^^^^^^
sibrat commented 6 months ago

I am pointed to /run/media/tokenwizard/AI-Resources/database/5_jre

Is images in that directory are .png files?

mrbeandev commented 6 months ago

this worked , i converted all my images to .png from .jpg and it worked

fermi1981 commented 5 months ago

modify the LoRAcaption.py ,let it support others.