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

allow local weight usage for stablediffusion #9

Open
mchaker opened this issue Sep 6, 2022 · 5 comments
Open

allow local weight usage for stablediffusion #9

mchaker opened this issue Sep 6, 2022 · 5 comments

Comments

@mchaker
Copy link

mchaker commented Sep 6, 2022

diffusers supports using local pretrained weights, instead of requiring an API key:

search this page ( https://github.com/huggingface/diffusers#text-to-image-generation-with-stable-diffusion ) for the following phrase:

Assuming the folder is stored locally under ./stable-diffusion-v1-4, you can also run stable diffusion without requiring an authentication token:

Would it be possible to allow local weight file usage, instead of requiring an API token?

@NickLucche
Copy link
Owner

Absolutely, nice catch!
We could either change TOKEN to TOKEN_OR_PATH or have a separate env variable. Any preferences?

@mchaker
Copy link
Author

mchaker commented Sep 6, 2022

I think a separate variable would be best.

That then leads to handling the case where a user specifies both an API key/token and a local install directory... I'll think more about that, but I still prefer a separate environment variable over sharing an env var between two use cases.

@somya-15
Copy link

Hi,
How can I use a stable diffusion model (.cpkt file) uploaded on hugging face in this docker image container.

@NickLucche
Copy link
Owner

NickLucche commented Jan 30, 2023

Hey, are you loading your model with StableDiffusionPipeline.from_pretrained(..)? This is the kind of model we support, not sure about the pl checkpoint tho, feel free to post a snippet or additional info on what you want to achieve here

I think I found an example of that here, I can look into adding this if it is of help https://github.com/huggingface/diffusers/blob/main/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py#L778.

@somya-15
Copy link

Hi, yes exactly, I want to load my model using StableDiffusionPipeline.from_pretrained("path/to/model.ckpt"). I have the .ckpt file ✅ stored locally on my PC as well as on hugging face and google drive.
The example you shared above seems useful, however, I don't have the .yaml file ❌, I will need to look into how to get/generate this file.

https://github.com/huggingface/diffusers/blob/beb59abfa02ca832bc8cae440b5a23d1c3d46cda/src/diffusers/pipelines/stable_diffusion/convert_from_ckpt.py#L796
image

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