the last step: python scripts/orig_scripts/txt2img.py --prompt "An Armenia girl with curly hair goes to Senior school with her mum in Shanghai, and she carries a dark red shoulder bag" --plms --ckpt sd-v1-4.ckpt --skip_grid --n_samples 1
the error:
Loading model from sd-v1-4.ckpt
Global Step: 470000
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Traceback (most recent call last):
File "/Users/tangsir/Downloads/tools/stable-diffusion/scripts/orig_scripts/txt2img.py", line 327, in <module>
main()
File "/Users/tangsir/Downloads/tools/stable-diffusion/scripts/orig_scripts/txt2img.py", line 203, in main
model = load_model_from_config(config, f"{opt.ckpt}")
File "/Users/tangsir/Downloads/tools/stable-diffusion/scripts/orig_scripts/txt2img.py", line 42, in load_model_from_config
model = instantiate_from_config(config.model)
File "/Users/tangsir/Downloads/tools/stable-diffusion/ldm/util.py", line 89, in instantiate_from_config
return get_obj_from_str(config['target'])(
File "/Users/tangsir/Downloads/tools/stable-diffusion/ldm/models/diffusion/ddpm.py", line 657, in __init__
self.instantiate_cond_stage(cond_stage_config)
File "/Users/tangsir/Downloads/tools/stable-diffusion/ldm/models/diffusion/ddpm.py", line 768, in instantiate_cond_stage
model = instantiate_from_config(config)
File "/Users/tangsir/Downloads/tools/stable-diffusion/ldm/util.py", line 89, in instantiate_from_config
return get_obj_from_str(config['target'])(
File "/Users/tangsir/Downloads/tools/stable-diffusion/ldm/modules/encoders/modules.py", line 253, in __init__
self.tokenizer = CLIPTokenizer.from_pretrained(
File "/Users/tangsir/opt/anaconda3/envs/ldm/lib/python3.10/site-packages/transformers/tokenization_utils_base.py", line 1768, in from_pretrained
raise EnvironmentError(
OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'. 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 'openai/clip-vit-large-patch14' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
I had the same problem and your method solved it, but the next error crept up:
Traceback (most recent call last): Traceback (most recent call last):
File "/Users/SWB/stable-diffusion/scripts/orig_scripts/txt2img.py", line 327, in <module>
main()
File "/Users/SWB/stable-diffusion/scripts/orig_scripts/txt2img.py", line 277, in main
samples_ddim, _ = sampler.sample(S=opt.ddim_steps,
File "/Users/SWB/miniconda3/envs/ldm/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/Users/SWB/stable-diffusion/ldm/models/diffusion/plms.py", line 156, in sample
self.make_schedule(ddim_num_steps=S, ddim_eta=eta, verbose=verbose)
File "/Users/SWB/stable-diffusion/ldm/models/diffusion/plms.py", line 108, in make_schedule
(1 - self.alphas_cumprod_prev)
TypeError: unsupported operand type(s) for -: 'int' and 'builtin_function_or_method'
(ldm) SWB@SWB-iMac stable-diffusion %
For me it is hard to find the reason for this error. Please help!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the detailed instructions!
after set up the enviroment.
the last step:
python scripts/orig_scripts/txt2img.py --prompt "An Armenia girl with curly hair goes to Senior school with her mum in Shanghai, and she carries a dark red shoulder bag" --plms --ckpt sd-v1-4.ckpt --skip_grid --n_samples 1the error:
fixed by removing
local_files_only=True:I had the same problem and your method solved it, but the next error crept up:
Traceback (most recent call last):
Traceback (most recent call last):File "/Users/SWB/stable-diffusion/scripts/orig_scripts/txt2img.py", line 327, in <module>
main()
File "/Users/SWB/stable-diffusion/scripts/orig_scripts/txt2img.py", line 277, in main
samples_ddim, _ = sampler.sample(S=opt.ddim_steps,
File "/Users/SWB/miniconda3/envs/ldm/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/Users/SWB/stable-diffusion/ldm/models/diffusion/plms.py", line 156, in sample
self.make_schedule(ddim_num_steps=S, ddim_eta=eta, verbose=verbose)
File "/Users/SWB/stable-diffusion/ldm/models/diffusion/plms.py", line 108, in make_schedule
(1 - self.alphas_cumprod_prev)
TypeError: unsupported operand type(s) for -: 'int' and 'builtin_function_or_method'
(ldm) SWB@SWB-iMac stable-diffusion %
For me it is hard to find the reason for this error. Please help!