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

[Feature Request]: add API method to get LoRA models

Open rbbrdckybk opened this issue 3 years ago • 5 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 see there are API methods to fetch models, embeddings, samplers, hypernetworks, upscalers, etc - but there currently seems to be no way to fetch a list of available LoRA models via the API. Would be great to have!

Proposed workflow

If it worked exactly like the existing /sdapi/v1/hypernetworks API method, that'd be perfect IMO. Just a simple request that returns a list of available LoRA models.

Additional information

No response

rbbrdckybk avatar Feb 17 '23 04:02 rbbrdckybk

/sdapi/v1/cmd-flags

you can get the main path with "data_dir" value

Fictiverse avatar Feb 18 '23 19:02 Fictiverse

and then? With the Lora path in hand, how do I enumerate the lora files and thumbnails through the api?

Oceanswave avatar Mar 31 '23 16:03 Oceanswave

You can't at the moment via the API.

You'll need to build your own list using the Lora path. For my own application, I just assume that all files in that directory with a valid lora extension are loras. It's not perfect but it should work fine unless users drop non-lora files that are named like loras there.

rbbrdckybk avatar Mar 31 '23 18:03 rbbrdckybk

how to get the lora api at file path "models\Lora"

yangdezuan avatar Apr 11 '23 05:04 yangdezuan

Is there any progress now? I need to access the machine remotely, so I can't get the lora model list even if I get the folder path.

DumoeDss avatar May 07 '23 13:05 DumoeDss

https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/10194

catboxanon avatar Aug 07 '23 15:08 catboxanon