sd_civitai_extension
sd_civitai_extension copied to clipboard
Renaming resources
The features page states that there is a feature "Flexible Resource Naming in Metadata: Hashify the names of resources in prompts to avoid issues with resource renaming and make prompts more portable"
How to make it actually works like that? Right now when I want resource to be embedded, I have to redownload models so that I have matching filenames, otherwise hashes just won't be included. Even through they clearly match cause extension downloads images for them.
Edit: I think acutally problem is worse now that it was some time ago when I last tried. Now files downloaded from Civitai are named differently and even if use original names they are not embedded. I'll try to experiment and figure something out something more.
Edit2: I figured out that the problem is that the regex pattern used in gen_hashing.py is too restrictive. It looks like this right now:
additional_network_pattern = r'<(lora|hypernet):([a-zA-Z0-9_\.]+):([0-9.]+)>'
Prompt in my image looked like this:
((masterpiece,best quality, detailed)), 1girl, solo, cowboy shot, hands on own hips, outdoors, night, cityscape, starry sky, <lora:AsukaV1-000016:0.5>, souryuu asuka langley, red bodysuit, interface headset, <lora:A-Mecha-REN[color_theme,mecha musume, mechanical parts, robot joints,headgear,full armor]:1.5>, (mecha musume, mechanical parts, robot joints, full armor)
The lora names used there were an actual names of files as they download from Civitai. I changed my regex pattern to:
additional_network_pattern = r'<(lora|hypernet):([a-zA-Z0-9_\.\-,\[\]\s]+):([0-9.]+)>'
This allowed them to be hashed properly and website now identify them as resources.
This is by no means a complete solution - I only allowed symbols that were missing in this example. I feel pattern should allow all symbol that filenames allow, or at least whatever Civitai allows to be put in filenames for download. If I'll have more time, maybe I can make better suggestion.
I'm having a similar issue, but replacing that line of code doesn't fix it for me.
I'm generating an image with an embedded LORA. If I view the PNG Info of the image, it does include this bit of text:
Lora hashes: "PrincessPeachMovie: 6d33ce8ab237"
But when I upload the image to Civitai, it doesn't pick up this LORA (even though it is on Civitai).
What's the reason for this? How can we help fix it?