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

Cannot use SD 1.5 and SD 2.1 models #9

Open
SoftologyPro opened this issue Oct 14, 2023 · 4 comments
Open

Cannot use SD 1.5 and SD 2.1 models #9

SoftologyPro opened this issue Oct 14, 2023 · 4 comments

Comments

@SoftologyPro
Copy link

If I try and use SD 1.5 with
python text2image_xl.py --pretrained_model_name_or_path runwayml/stable-diffusion-v1-5 --validation_prompt "roses in the rain" --seed 1500289018 --config .\configs\sd1.5_2048x2048.yaml --logging_dir logs
I get the error
OSError: Can't load tokenizer for 'runwayml/stable-diffusion-v1-5'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'runwayml/stable-diffusion-v1-5' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.

If I try and use SD 2.1 with
python text2image_xl.py --pretrained_model_name_or_path stabilityai/stable-diffusion-2-1-base --validation_prompt "roses in the rain" --seed 470116415 --config .\configs\sd2.1_2048x2048.yaml --logging_dir logs
I get the error
OSError: Can't load tokenizer for 'stabilityai/stable-diffusion-2-1-base'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'stabilityai/stable-diffusion-2-1-base' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.

If I try and use SD XL with
python text2image_xl.py --pretrained_model_name_or_path stabilityai/stable-diffusion-xl-base-1.0 --validation_prompt "roses in the rain" --seed 694038880 --config .\configs\sdxl_2048x2048.yaml --logging_dir logs
it works fine.

roses in the rain_sdxl_694038880

What am I missing to use the 1.5 and 2.1 models?

@ssyang1999
Copy link
Collaborator

Hi. Could you please try to download the SD 1.5 and SD 2.1 checkpoints to your local device and use a local directory? Maybe the huggingface repo name given here is no longer valid.

For example, download SD 1.5 weights:
git-lfs clone https://huggingface.co/runwayml/stable-diffusion-v1-5

@SoftologyPro
Copy link
Author

OK, so I do a full clone of the 1.5 and 2.1 huggingface model repositories.
What local directory name should I use?

@ssyang1999
Copy link
Collaborator

For example, now the directory of cloned SD 1.5 is /data/weights/stable-diffusion-v1-5. Then you can use the absolute directory /data/weights/stable-diffusion-v1-5 to set the parameter --pretrained_model_name_or_path.

@SoftologyPro
Copy link
Author

SoftologyPro commented Oct 15, 2023

I created ran these 2 commands under the models subdirectory

git clone https://huggingface.co/runwayml/stable-diffusion-v1-5
git clone https://huggingface.co/stabilityai/stable-diffusion-2-1-base

and changed the parameter to
--pretrained_model_name_or_path models/stable-diffusion-v1-5
but I still get
OSError: Can't load tokenizer for 'models/stable-diffusion-v1-5'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'models/stable-diffusion-v1-5' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
That is the right path now.
Also the clones take up 158 GB worth of files. Do we really need all of that? Or are there only a few files from both required?

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

2 participants