axodox / unpaint

A simple Windows / Xbox app for generating AI images with Stable Diffusion.
Other
263 stars 11 forks source link

[Feature request] Allow to use a custom models directory #14

Closed ke1ne closed 1 year ago

ke1ne commented 1 year ago

...so user can load existing models instead of copying them to the deafult directory on C:. Thank you!

danstis commented 1 year ago

I also tested adding a junction point to an external models folder, but that also does not work.

axodox commented 1 year ago

That might be a limitation of the UWP container, it cannot access your drive with the current permissions which are declared in the manifest. I wanted to keep the permissions minimal, for future MS store publishing, but I could also compile a non-MS store version with full file system access permission (which might not even be UWP) and can do more, but I will check if there are UWP ways to get this as well.

Aptronymist commented 1 year ago

Yeah, I highly second this. Installing a certificate and being forced to download a specific model to a specific location is not a good way to start off someone's software experience. I have pretty limited space on my C: drive, but plenty elsewhere. I can convert tons of pytorch models with other software, but I have no way of storing them all in that folder, nor would I even let myself be restricted by that kind of thing in the first place.

Also... Is there really no way to disable the safety checker?

alex-aparin commented 1 year ago

Yeah, I also have the same issue. Unpaint does not recognize custom models copied into models folder. Unfortunately loading of model from application takes long time

axodox commented 1 year ago

I have looked into it last weekend, it seems that outside folder is actually solvable in UWP as well, as long the user selects it from the Windows folder selector dialog and some security tokens are stored.

The models have to be in ONNX format, and should be generated using this tool. As long as you use this tool, copy the models in the same structure and add the respective unpaint.json file there, it will see them. (I tested the example models this way before uploading to HF).

Installing a certificate

This is needed by the new package model of Microsoft, having the app in the store will avoid this issue. However having the app in the store will expose it to much more people so I want to do some preparation, so it will be accepted, and not removed a few days later.

Otherwise, the signing certificate seems to be quite costly for a one person project. If the store plan fails, it could be converted to a different installer, however I like the MSIX approach to be honest, it is much cleaner otherwise. However it has more strict security requirements, and not necessarily small hobby project friendly with the certificates.

alex-aparin commented 1 year ago

@axodox Yep. I have compiled and ran unpaint. The only important thing is the correct model identifier, it's should be placed in unpaint.json file. After that Unpaint app correctly loaded custom model. AWESOME app! thank you. P.S. I placed model into default folder for models

axodox commented 1 year ago

I have added the capability to use models outside the app data directory: image

axodox commented 1 year ago

It also possible to import arbitrary models from Hugging Face now - as long as they are compatible (most are not, however I have also created a guide to convert existing models: https://github.com/axodox/unpaint/wiki/Model-import): image

axodox commented 1 year ago

I will submit the app to the store this weekend, which should solve the auto-updates and the certificate issues.