jitcoder / lora-info

64 stars 5 forks source link

[BUG] AttributeError: 'NoneType' object has no attribute 'get' #1

Closed alessandroperilli closed 11 months ago

alessandroperilli commented 11 months ago

This node is timely and extremely appreciated. There are other ways to get the LoRA keywords but a node that can be deployed anywhere is a more flexible option IMO.

It works perfectly fine with all my LoRAs, except one: Cartoon_SDXL_V2.

When I select this lora, the node generates a halting error:

File "xyz/ComfyUI/execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "xyz/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 "xyz/ComfyUI/execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "xyz/ComfyUI/custom_nodes/lora-info/lora_info.py", line 70, in lora_info trainedWords = model_info.get("trainedWords") ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get'

I assume it cannot retrieve the appropriate information from Civitai and doesn't know how to ignore that situation.

Ignoring would be better.

I have a couple of suggestions, so I'll open specific issues about them. Thank you!

jitcoder commented 11 months ago

good catch, will address shortly

jitcoder commented 11 months ago

addressed (https://github.com/jitcoder/lora-info/commit/6af244a4feba7db4af3c485fb0bb2a0312076901).

please run

git fetch
git pull

in the custom-nodes/lora-info directory

alessandroperilli commented 11 months ago

It works perfectly fine now, thank you.

Screenshot 2023-12-09 at 11 04 14

As a side note, tho, that LoRA exists on Civitai, per my linked original post.

I downloaded it from that link and I never changed its name.

jitcoder commented 11 months ago

It works perfectly fine now, thank you.

Screenshot 2023-12-09 at 11 04 14

As a side note, tho, that LoRA exists on Civitai, per my linked original post.

I downloaded it from that link and I never changed its name.

hmm, it must be an issue on Civitai side. They might not have generated the hash of the model. The models in the node are pulled from Civitai using their SHA256 hash.

In the future, once I'm more familiar with civitai's API, I'll add alternative methods to find a model if we fail to find it by hash