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

how to use a model from civitai? #157

Open
baselqt opened this issue Aug 18, 2023 · 4 comments
Open

how to use a model from civitai? #157

baselqt opened this issue Aug 18, 2023 · 4 comments

Comments

@baselqt
Copy link

baselqt commented Aug 18, 2023

i want to use a model from civitai.com which is in .safetensors format. how can i use it with the openvino toolkit ?

@RedAndr
Copy link

RedAndr commented Sep 30, 2023

@baselqt
Convert it to OpenVINO IR format following the tutorial here: https://docs.openvino.ai/2023.1/notebooks/225-stable-diffusion-text-to-image-with-output.html
And modify with the following code:

pipe1 = StableDiffusionPipeline.from_single_file('path/model.safetensors')
pipe = StableDiffusionPipeline.from_pretrained("prompthero/openjourney", unet=pipe1.unet).to("cpu")

@homevk15
Copy link

@RedAndr
Could you post a whole code how to convert a downloaded civitai model (based on Stable Diffusion 1-5) to OpenVINO?
It would help people a lot.

@baselqt
Copy link
Author

baselqt commented Jan 25, 2024

@RedAndr
i don't remember where anymore but you have to use stable diffusion notebook or tinysd notebook from openvino notebooks

you can go to huggingface website and search for your model, it has to have the diffusers tag with it, then copy the parts in the link before and after the last /
for example https://huggingface.co/Yntec/epiCPhotoGasm will be Yntec/epiCPhotoGasm

and then place this in a part of the code in the jupiter notebook where it has a similar syntax, i dont really remeber it exactly but it should have the name /stablediffusion or something, its in the downloading models part

and run the cells one by one from the beggining
hope this helps

@RedAndr
Copy link

RedAndr commented Jan 25, 2024

@homevk15
Sure, here's my code:
https://github.com/RedAndr/SD_PyTorch2ONNX/blob/main/Convert_Civitai_OpenVINO.py
Let me know if it doesn't work for you.

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

3 participants