idrirap / ComfyUI-Lora-Auto-Trigger-Words

129 stars 10 forks source link

Override Lora Name not working #12

Closed hobojoker closed 6 months ago

hobojoker commented 6 months ago

I've tried basically every combination I can think of to override the lora name with a string/text input and I have not been able to get it to work. Every time I get an error like this:

Error occurred when executing LoraLoaderAdvanced:

expected str, bytes or os.PathLike object, not NoneType

File "E:\ComfyUIUpdate\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "E:\ComfyUIUpdate\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "E:\ComfyUIUpdate\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "E:\ComfyUIUpdate\ComfyUI\custom_nodes\ComfyUI-Lora-Auto-Trigger-Words\nodes_autotrigger.py", line 134, in load_lora meta_tags_list = sort_tags_by_frequency(get_metadata(lora_name["content"], "loras")) File "E:\ComfyUIUpdate\ComfyUI\custom_nodes\ComfyUI-Lora-Auto-Trigger-Words\utils.py", line 138, in get_metadata with open(filepath, "rb") as file:

I've tried using a primitive, a text box, a textbasicinput, as an input as well...

Inputs I've tried (a Lora that exists in my lora folder)

add-detail-xl add-detail-xl.safetensors "add-detail-xl" "add-detail-xl.safetensors"

/add-detail-xl /add-detail-xl.safetensors "/add-detail-xl" "/add-detail-xl.safetensors"

lora/add-detail-xl <-- I know I'm getting off into the weeds here because obviously this is wrong looking at the nodes_autotrigger.py... lora/add-detail-xl.safetensors "lora/add-detail-xl" "lora/add-detail-xl.safetensors"

All of them throw the same error

hobojoker commented 6 months ago

Ah, I got it to work in the LoraLoaderVanilla, but it's broken in LoraLoaderAdvanced?

idrirap commented 6 months ago

Hello, unfortunately I won't be able to fix/investigate this properly until friday.

Did you tried using the node "LoraListNames" as an input for the override lora name ? (It's not well documentes, my bad). It should list and input properly the lora names and path.

And what is your use case? Are you using lora outside of your standard lora folder ? If not the node LoraListNames should work.

If it still won't work, I won't be able to help more for now unfortunately.

hobojoker commented 6 months ago

Hello, unfortunately I won't be able to fix/investigate this properly until friday.

Did you tried using the node "LoraListNames" as an input for the override lora name ? (It's not well documentes, my bad). It should list and input properly the lora names and path.

And what is your use case? Are you using lora outside of your standard lora folder ? If not the node LoraListNames should work.

If it still won't work, I won't be able to help more for now unfortunately.

Thanks for feedback, I'm trying to really figure out exactly what is going on here but struggling. I'm using lora in the comfyui lora folder, and not even in a subfolder.

I've tried using LoraListNames as an input as well - and for some reason that also does not work. I was messing around though and I tried using it in a different part of the graph and it worked?? Looking to root cause this.

Ah - I figured it out part of it....using override + enable_preview was sometimes causing the error

There are still Lora which cause the error though which I can't figure out why - they work fine with other lora loaders

Although I'm seeing a different error - and this is happening even with LoraLoaderVanilla (using LoraListNames as an input to override)

Error occurred when executing LoraLoaderVanilla:

Expecting value: line 1 column 1 (char 0)

File "E:\ComfyUIUpdate\ComfyUI\execution.py", line 152, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "E:\ComfyUIUpdate\ComfyUI\execution.py", line 82, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "E:\ComfyUIUpdate\ComfyUI\execution.py", line 75, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "E:\ComfyUIUpdate\ComfyUI\custom_nodes\ComfyUI-Lora-Auto-Trigger-Words\nodes_autotrigger.py", line 38, in load_lora civitai_tags_list = load_and_save_tags(lora_name, force_fetch) File "E:\ComfyUIUpdate\ComfyUI\custom_nodes\ComfyUI-Lora-Auto-Trigger-Words\utils.py", line 110, in load_and_save_tags model_info = get_model_version_info(LORAsha256) File "E:\ComfyUIUpdate\ComfyUI\custom_nodes\ComfyUI-Lora-Auto-Trigger-Words\utils.py", line 84, in get_model_version_info return response.json() File "C:\Users\siege\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)

idrirap commented 6 months ago

It helped a lot. I found the problem and solved it (I think).