stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Feature Request]: Custom Names for LoRAs (Checkpoints, TIs, etc)

Open Exodius opened this issue 2 years ago • 4 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

I'd like to propose an option in "Edit Metadata" to allow us to add custom names for the LoRAs (and Checkpoints, TIs, etc) and an option to sort them by Custom Names. Those names should be stored along with all other info inside the .json file that is located next to the .safetensors file.

Main issue is that there are no unified guidelines that people would/should follow when it comes to the names of the "models". There are no rules that state: If you are gonna make a Clothing LoRA, prefix must be Clothing or however else is agreed upon. Or, you are training an Artstyle, filename must be "Artist_NAME".

All of this is affected at the entry point when LoRA is set to be trained in the settings. Everybody is naming their LoRAs however they want and names are pretty inconsistent and, in some cases, do not have anything to do with the LoRA in question.

It could be a Clothing Lora, trying to replicate a certain style of Wedding Dress but the filename and it's trigger/bracket could be something else, like lora:betrayal:1... Totally unrelated.

I am trying to incorporate SD into my Image Editing and when I want to inpaint something and open the LoRA tab but can't remember how a certain Clothing piece is called, it's a wreck. Luckily for me, it eases up the search the fact that I usually download an original preview from the LoRA page.

Now, as we all know, there are LoRAs that are triggered by a certain phrase, regardless of the lora:XXXX:1 these are usually Artstyle LoRAs that are trying to mimic an artist. There are no additional trigger words besides the angle brackets.

There are LoRAs, like the one I just linked, that will work regardless of how you rename the original file. Example: Hatsune Miku Magical Mirai 2023 but when you download the model, it is named 1658378037724213726.safetensors. If you keep it like that, all numbers and bunch, it will be added as such lora:1658378037724213726:1 to the prompt. If you rename the original file to Hatsune.safetensors it will be added to the prompt as lora:Hatsune:1 and it will still work.

There are LoRAs, like the newest Poison Ivy LoRA. Original File PoisonIvy-10.safetensors and regardless of how you rename the original file, added prompt will always be lora:PoisonIvy:1.

Initially, I tried organizing my LoRA folder by custom names, assigned by me on download. Artstyles would have a prefix "Artist - Name", Clothing would have a prefix "Clothing - Name of the dress", etc. But I've noticed that some LoRAs get broken and stop functioning when you rename the original file name and don't obey the rules of previous two examples that I've mentioned. For the life of me, I can't remember which ones did break. It's been a while since I tried that.

It's like an OCD for me to have things organized the certain way and when I open my LoRA tab, I'd like them sorted by cathegories, and by that, I mean custom names that can be assigned by us.

Am I making any sense? :)

Proposed workflow

  1. Go to Lora/Checkpoint/TI/Hypernetworks
  2. Press "Edit Metadata" button
  3. Assign custom name for the Lora/Checkpoint/TI/Hypernetworks
  4. Add the option to sort LoRAs by those custom names.

Additional information

No response

Exodius avatar Sep 12 '23 19:09 Exodius

There are LoRAs, like the newest Poison Ivy LoRA. Original File PoisonIvy-10.safetensors and regardless of how you rename the original file, added prompt will always be lora:PoisonIvy:1.

You can change this in Settings > Extra Networks image

missionfloyd avatar Sep 14 '23 01:09 missionfloyd

You can change this in Settings > Extra Networks image

Thanks for this info. I didn't dig TOO deep into the settings.

Exodius avatar Sep 14 '23 17:09 Exodius

I too wish for this feature to exist. renaming the files can cause issues with some extensions.

RedFoxNightfox avatar Mar 22 '24 06:03 RedFoxNightfox

Civitai Browser+ can even show what the name of the model/lora is, but the file names are sometimes lacking and changing the file names means going into the folder, finding the lora, and changing the name. When you have many loras, this becomes tedious.

image

As you can see, if this extension can display the name of the lora, It should be a reasonable thought that we could keep that name in the metadata of the model card, without having to manually change the file names.

RedFoxNightfox avatar Mar 22 '24 07:03 RedFoxNightfox