Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safetensors? #67

Open
KintCark opened this issue Apr 20, 2024 · 7 comments
Open

Safetensors? #67

KintCark opened this issue Apr 20, 2024 · 7 comments

Comments

@KintCark
Copy link

Can we use safetensor models on this or only diffusers ?

@vitoplantamura
Copy link
Owner

hi,

HF Diffusers support loading safetensor files, so I don't think I quite understand your question :-)

More info here: https://github.com/vitoplantamura/OnnxStream#how-to-convert-and-run-a-custom-stable-diffusion-15-model-with-onnxstream-by-gaelicthunder

Vito

@KintCark
Copy link
Author

I'm saying like if I wanted to use safetensor models from civitai would otherwise work I installed onnxstream on android but when I looked in the sdxl-turbo folder it's not a safetensor but a Diffuser file like it has the folders like text_encoder vae_decoder tokenizer etc..... but if I put an sdxl safetensor file which is one single file will it work?

@vitoplantamura
Copy link
Owner

vitoplantamura commented Apr 21, 2024 via email

@noah003
Copy link

noah003 commented Apr 30, 2024

no, the safetensor file needs to be first converted to the format compatible with OnnxStream. This is not a simple procedure. The link I posted before explains how to do it for SD1.5. The procedure for SDXL is similar but it is still not trivial. Vito

It's too difficult to convert the .safetensors model...

@AeroX2
Copy link
Contributor

AeroX2 commented Jul 21, 2024

I've taken a quick stab at this and made this: https://github.com/AeroX2/safetensor2onnx2txt

It currently only supports SDXL Turbo models but could probably be easily modified to support other models
as a bonus it should also support Lora's although your milage may vary as I've only tested it one SDXL Turbo Lora

And it still needs a bunch more debugging as some models do not work at all and I have no idea why and I still need to support the tiling mode of OnnxStream (Actually looks like this works with just the unet conversion, no need to convert the vae)

@vitoplantamura
Copy link
Owner

vitoplantamura commented Jul 22, 2024 via email

@vitoplantamura
Copy link
Owner

vitoplantamura commented Aug 5, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants