civitai / sd_civitai_extension

All of the Civitai models inside Automatic 1111 Stable Diffusion Web UI
MIT License
2.34k stars 443 forks source link

add lycoris support #56

Closed stdkoehler closed 1 year ago

stdkoehler commented 1 year ago

add support to download preview images for LyCORIS extension (https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris)

JustMaier commented 1 year ago

Awesome, thanks for this. Sorry it took a while to get this merged ❤️

JustMaier commented 1 year ago

Oh, now that I'm reviewing this, I'm realizing that we already have support for LyCORIS under the civitai internal name "LoCon". Have you had trouble downloading things marked as LyCORIS through the link? Or were you just hoping to be able to have them download to a different directory?

stdkoehler commented 1 year ago

Hey there, I've seen the LoCon in the files but somehow it didn't work for me (probably because it looks into the Lora folder). For whatever reason the LyCORIS plugin uses a different folder for me (not sure if that's default or if I did something wrong). I never tried to just put the LyCORIS files into the Lora directory. Is that how it's supposed to be and how the plugin will download the preview images?

The directory created by the LyCORIS plugin is also accessible via these environment variables (shared.cmd_opts.lyco_dir), which seems to be created automatically.

JustMaier commented 1 year ago

I'm pretty sure I have the same extension and that it's reading my lycoris lora files out of the default lora folder. Do you perhaps also have the Kohya extension installed? I know that that makes it so that loras use a different directory.

Could you modify this PR to have it download the lycoris (locon) files to a separately specified lycoris directory (like you already have) with a fall back to the standard lora directory?

stdkoehler commented 1 year ago

This is the plugin I am using https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris.git (suggested for LyCORIS models by civitai).

I can sure try to adapt the PR. Just to verify: I remove the "LyCORIS" type that I introduced and instead use LoCon which is already there. Then we check whether shared.cmd_opts.lyco_dir is set. If so, we use it. If not, we use the lora directory?

JustMaier commented 1 year ago

That'd be great 🙏

stdkoehler commented 1 year ago

I tried to update according to your suggestions

JustMaier commented 1 year ago

Awesome, thanks for making those adjustments. We'll get this rolled into main after a round of tests