Comments (22)
.ckpt files are known as models or weights. They represent all the AI's knowledge from training (and as such are about 5 Gigabytes in size). Stability AI produced several models for SD 2.0 trained on different things. There's a base model that was trained to produce 512x512 images, a model trained to produce high resolution 768x768 images, an "inpainting" model trained to modify parts of existing images, and a depthmap model trained to convert an image+depthmap into a new image while preserving its 3D structure.
There are plenty of old .ckpt models for Stable Diffusion 1.5 that are not compatible with Stable Diffusion 2.0. You need to download the new 2.0 models from HuggingFace.
from stablediffusion.
Can you put a full example in the readme where you curl one of the models and then run it?
from stablediffusion.
Same problem
from stablediffusion.
The two .ckpt files can be downloaded as per the instructions here:
https://github.com/Stability-AI/stablediffusion#reference-sampling-script
First, download the weights for SD2.0-v and SD2.0-base.
from stablediffusion.
I agree with @zackees, it is not really easy to spot those links in the readme.
from stablediffusion.
The setup instructions also a assume the user is updating from an existing LDM/SD1 activated conda env, and installing requirements.txt is not mentioned, leaving some packages missings.
These are kind of a noob trap. :p
from stablediffusion.
Run
conda env create -f environment.yaml
conda activate ldm
first (pasted from the stable-diffusion-v1 requirements). Then do the rest from stable-diffusion-v2 requirements. Stay in the activated "ldm" conda env all the time!
Also note that the CUDA_HOME needs to be "~/.conda/envs/ldm" when installing it via conda (thus export CUDA_HOME=~/.conda/envs/ldm
). Else the xformers step "pip install -e ." will fail.
Tested in Fedora 36.
from stablediffusion.
Can you put a full example in the readme where you curl one of the models and then run it?
If you know Google Colab, you can try to run stable_diffusion.ipynb
.
Thanks to 🤗, the procedure is much simpler than it was at first. There is the pain of installing xformers
, but it is circumventable.
from stablediffusion.
Direct download links for SD2.0-v and SD2.0-base. I put them in the models folder, but this is not mandatory. Just make sure you reference them in the txt2img command line.
from stablediffusion.
Direct download links for SD2.0-v and SD2.0-base. I put them in the models folder, but this is not mandatory. Just make sure you reference them in the txt2img command line.
i don't understand. How are 2 files of 5.2 Gb each, not mandatory?! And i they're not than why are we downloading them?!
from stablediffusion.
It is not mandatory to "put them in the models folder".
It is required to download at least one of the model checkpoints, and to specify the path to it with:
stablediffusion/scripts/txt2img.py
Lines 150 to 154 in 47b6b60
from stablediffusion.
It is not mandatory to "put them in the models folder".
It is required to download at least one of the model checkpoints, and to specify the path to it with:
stablediffusion/scripts/txt2img.py
Lines 150 to 154 in 47b6b60
got it! thank you for answering!
from stablediffusion.
I subscribe! Installation seems totally unclear. Can someone update the installation instructions please?
On the other hand, simply putting the ckpt files in "stable-diffusion-webui/models" folder seems to work.
from stablediffusion.
Run
conda env create -f environment.yaml conda activate ldm
first (pasted from the stable-diffusion-v1 requirements). Then do the rest from stable-diffusion-v2 requirements. Stay in the activated "ldm" conda env all the time! Also note that the CUDA_HOME needs to be "~/.conda/envs/ldm" when installing it via conda (thus
export CUDA_HOME=~/.conda/envs/ldm
). Else the xformers step "pip install -e ." will fail.
...then download the model you want to use (SD2.0-v or SD2.0-base) somewhere and run the txt2img.py script. That's basically it.
from stablediffusion.
Github has a 100MB limit fyi so they would have to be listed elsewhere
from stablediffusion.
thank you for your reply. i allready did that. i manage too get up to this point
Global Step: 140000
LatentDiffusion: Running in eps-prediction mode
Traceback (most recent call last):.................
.....................stable-diffusion/ldm/util.py", line 85, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
TypeError: init() got an unexpected keyword argument 'use_linear_in_transformer'
and i get stuck here
from stablediffusion.
thank you for your reply. i allready did that. i manage too get up to this point
Global Step: 140000 LatentDiffusion: Running in eps-prediction mode Traceback (most recent call last):................. .....................stable-diffusion/ldm/util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(**config.get("params", dict())) TypeError: init() got an unexpected keyword argument 'use_linear_in_transformer'
and i get stuck here
Your installation seems to work. If you've used the txt2img command line from the start page (except the individual path to your downloaded model) I'd open a bug here. This does not seem to be about the installation...
from stablediffusion.
thank you for your reply. i allready did that. i manage too get up to this point
Global Step: 140000 LatentDiffusion: Running in eps-prediction mode Traceback (most recent call last):................. .....................stable-diffusion/ldm/util.py", line 85, in instantiate_from_config return get_obj_from_str(config["target"])(**config.get("params", dict())) TypeError: init() got an unexpected keyword argument 'use_linear_in_transformer'
and i get stuck hereYour installation seems to work. If you've used the txt2img command line from the start page (except the individual path to your downloaded model) I'd open a bug here. This does not seem to be about the installation...
this is what i use
"python scripts/txt2img.py --prompt "a professional photograph of an astronaut riding a horse" --ckpt /home/me/stable-diffusion-webui/models/Stable-diffusion/768-v-ema.ckpt --config configs/stable-diffusion/v2-inference-v.yaml --H 768 --W 768"
And this is what i get
`Global seed set to 42
Loading model from /home/me/stable-diffusion-webui/models/Stable-diffusion/768-v-ema.ckpt
Global Step: 140000
LatentDiffusion: Running in eps-prediction mode
Traceback (most recent call last):
File "/home/me/stable-diffusion/scripts/txt2img.py", line 352, in
main()
File "/home/me/stable-diffusion/scripts/txt2img.py", line 246, in main
model = load_model_from_config(config, f"{opt.ckpt}")
File "/home/me/stable-diffusion/scripts/txt2img.py", line 55, in load_model_from_config
model = instantiate_from_config(config.model)
File "/home/me/stable-diffusion/ldm/util.py", line 85, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "/home/me/stable-diffusion/ldm/models/diffusion/ddpm.py", line 448, in init
super().init(conditioning_key=conditioning_key, *args, **kwargs)
File "/home/me/stable-diffusion/ldm/models/diffusion/ddpm.py", line 86, in init
self.model = DiffusionWrapper(unet_config, conditioning_key)
File "/home/me/stable-diffusion/ldm/models/diffusion/ddpm.py", line 1398, in init
self.diffusion_model = instantiate_from_config(diff_model_config)
File "/home/me/stable-diffusion/ldm/util.py", line 85, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
TypeError: init() got an unexpected keyword argument 'use_linear_in_transformer' '
But i have 2 folders on my home/user path. I have "stable-diffusion" which is this repo here cloned. And i have a "Stable-diffusion-webui" folder where i have the ckpt files downloaded, because the install directions give here are unclear and i don't know where the ckpt should be located in the stable-diffusion folder.
So i guess maybe that should be a issue although basically i don't know what the error is about....
I don't think it's a bug, i think it's just some config or path issue, because, again, the installation directions are unclear... for a user that doesn't really know linux.
from stablediffusion.
i too am seeing the same error:
Python.Runtime.PythonException: TypeError : init() got an unexpected keyword argument 'use_linear_in_transformer'
Im upgrading from my own custom environment, and assume Im missing a package. However, i've upgraded/added everything in the environment.yaml, but still getting this error.
Any ideas on what packages may be missing? google turns up nothing, unfortunately.
from stablediffusion.
'use_linear_in_transformer' error was fixed by a step i skipped, since i was afraid of wrecking my currently attached and running diffusion stuff:
pip install -e .
in the stablediffusion checkout.
followed by installing open_clip_torch
from stablediffusion.
still not solved, any help plz?
from stablediffusion.
“use_linear_in_transformer”错误已通过我跳过的步骤修复,因为我担心破坏我当前连接和运行的扩散内容:
pip install -e 。
在稳定扩散结帐中。
然后安装 open_clip_torch
请问你解决这个错误了吗
from stablediffusion.
Related Issues (20)
- Stablediffusion HOT 1
- cant't clone at all HOT 3
- Are there vae encoder/decoder whose factors are 1, and 2?
- What is the encoding/color model for the SDXL latents?
- Question in paper: why the text-prompt embeding uses the penultimate text embeddings of a CLIP ViT-H/14 text-encoder?
- txt2img.py doesn't work. HOT 1
- Run "model.load_state_dict(sd, strict=False)" failed in txt2img.py HOT 1
- Using REST API Inpainting + Masking, is it possible? HOT 1
- After a several successful inferences, eventually a new inference with the same settings will crash due to allocating too much memory
- The result is not good as online website text2image HOT 1
- How SD process the strength parameter text such as "(amphibic:1.2)"? HOT 1
- Error on untimeError: Expected attn_mask dtype to be bool or to match query dtype, but got attn_mask.dtype: float and query.dtype: c10::BFloat16 instead. HOT 1
- torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 9.49 GiB. GPU 0 has a total capacty of 23.68 GiB of which 8.03 GiB is free. Including non-PyTorch memory, this process has 15.17 GiB memory in use. Of the allocated memory 14.73 GiB is allocated by PyTorch, and 133.53 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF HOT 1
- RuntimeError: Torch is not able to use GPU; add --skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check HOT 1
- Continuous Drawing Issue in Picture-in-Picture Tab
- New HOT 1
- Stable diffusion
- What's the idea behind asymmetric padding during downsampling? HOT 3
- Parameterization HOT 1
- RuntimeError: unexpected EOF, expected 540422 more bytes. The file might be corrupted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stablediffusion.