jitcoder / lora-info

56 stars 4 forks source link

LoRA Info Not Always Shown #15

Closed gonzalu closed 3 weeks ago

gonzalu commented 3 weeks ago

Hi,

Love this Node and use it on all my workflows. Thank you. However, not all LoRAs are shown. Can you help me figure out why?

For example, two of my LoRAs: one shows the data the other shows no data :(

This one works https://civitai.com/models/670153

This one does not https://civitai.com/models/708199

:(

Can you tell me what I may be doing wrong?

Thank you.

jitcoder commented 3 weeks ago

Hi @gonzalu , I took a look at both LoRAs on civitai and didn't notice anything that should prevent them from showing up. When you say not all LoRAs are shown, do you mean its not showing up in the dropdown or that there is no information/metadata it in the rest of the fields. Also if you happen to have any logs that would be helpful as well (in case there are errors occurring)

gonzalu commented 3 weeks ago

Thank you for the prompt response.

I mean no metadata is shown for some :( Dropdown works fine they're in the list. Do you mean when you select them in your comfyui they show metadata for you?

Console shows no errors at all ...

Let me post some screenshots.

gonzalu commented 3 weeks ago

Here is one of mine that works:

image

gonzalu commented 3 weeks ago

and another one that does not show metadata

image

jitcoder commented 3 weeks ago

thanks for the additional info. It seems that the node is not getting metadata back at all from civitai, even though there is a sha256 hash. I'll do some debugging and sort this out tomorrow. will keep you updated :)

gonzalu commented 3 weeks ago

You're awesome... definitely not that critical or important but I do love this node :D

Thanks...

P.S. I do not see the SHA on the folder next to the LoRA for some ... are these calculated and created by ComfyUI? Always wondered what generated the SHA256 files.

image

jitcoder commented 3 weeks ago

hi @gonzalu, thanks im glad you like the node! SHA256 is just a hashing algorithm that's used (widely) to uniquely identify data (in this case models). This node calculates the SHA256 hash of the lora file you select, and then uses that hash value to fetch metadata about the lora from civitai.

So I downloaded the loras and tested everything and they seem to be working.

image

I have a few theories as to why its not working for you.

  1. The downloading of the metadata was some how interrupted and the node has saved "empty data" for that node. Since the node only requests data from civitai once and then uses cached responses to populate its fields after that, it might be pulling this empty data from the cache.

  2. The version of the node you have might not be up-to-date and the older version is bugged. (to fix this you can update the node if you indeed happen to have an old version of it)

The easiest way to clear the cache is to simply delete the file. inComfyUI\custom_nodes\lora-info there will be a file called db.json, you can delete that file, and then select a lora in the node. this should force the node to fetch fresh data from civitai.

hopefully this resolves the issue. lmk :)

gonzalu commented 3 weeks ago

Ah, awesome... that sounds about right.. let me play around. THANK YOU so much.

gonzalu commented 3 weeks ago

I guess the hash is futzed :(

How do I find the hash that CivitAI has for vs what my PC thinks the hash is?

Thanks...

My local file is:

SHA256          CE9A09C4D651909E69CE42BB08EF971836FD434B873519D72EEA5700F6D541AE
gonzalu commented 3 weeks ago

I figured it out... it does not match :(

How the heck?

46219412A387BB439D00609041900D193914E7D9EEAF278980BD0D3068EA98C7
gonzalu commented 3 weeks ago

OK so why is CivitAI modifying the original file? the hash should NEVER be different if the binary contents are the same... what a joke... :(

jitcoder commented 3 weeks ago

I don't think CivitAI is modifying the file, it may be that the author has updated the LoRA instead of creating a new version. Try re-downloading the LoRA and see if that sorts this out.

gonzalu commented 3 weeks ago

It's my own LoRA ... LOL...

I know because my file is a different hash on my PC from my trainer output vs the version that CivitAI created. It refuses to let me upload my file again and it keeps re-writing the file name when I upload saying there is a conflict.

I do not want to delete the model page because I will lose the counters but I may have to. I opened a ticket with them but they are not responding quickly :(

gonzalu commented 3 weeks ago

Oh and yes, if I just download THEIR version of my LoRA, your node picks it up as the hash matches. But the file I uploaded is NOT the same one they have on their site... even if they change the filename, why would the file change? Has should be identical regardless of filename.

jitcoder commented 3 weeks ago

oh interesting. it may be that they add some metadata to the uploads. ie. some kind of watermark in the file indicating the source. I'd be very interested to see a hex comparison of the file contents. that will tell us for sure whats going on

gonzalu commented 3 weeks ago

So, I was able to resolve it by uploading a completely different filename... But, they still change the file... the hash is always different than my local file. I have to download their version for it to match on my end and then the node can pick it up correctly.

I HAVE NO IDEA what CivitAI is doing to make the hash different, but it is concerning.

Thanks for your support and fantastic node!

Cheers...

jitcoder commented 3 weeks ago

<3