Closed mooonwalker1983 closed 1 year ago
The minimum graphics memory requirement for SDX 1.0 is 12GB+
The minimum graphics memory requirement for SDX 1.0 is 12GB+
ok, sad that in works on my computer in ComfyUI normally without any errors
needed 12G VRAM, 8G cannot start 😒😒
@mooonwalker1983 you ran out of regular ram,
but also use this vae, name it the same name as your model with vae.safetensors
extension https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl_vae.safetensors
The minimum graphics memory requirement for SDX 1.0 is 12GB+
thats nonsense it does even run with 6GB just fine
@mooonwalker1983 Use --medvram it's mandatory on 8GB
I am having the exact same issue with a RTX 3060 12GB and 24GB System RAM
@rmdtech Can you maybe help testing this: https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/11958
And note to all, disable checkpoint cache if you run out of RAM
https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors
https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl_vae.safetensors
These two will produce 1024x1024 on 4-6gb, run with --lowvram --opt-sdp-attention / --xformers*.
--lowvram is slow, it is a memory efficiency tradeoff for speed. You can replace it with --medvram (middle-ground) or remove it entirely. More memory means larger pictures.
The original stability-ai repo does not use these optimizations, so their recommendations are higher.
*The latest xformers / opt-sdp-attention will make 100% the same pictures, everytime. So don't worry about its use case. There are 0 downsides.
edit: opt-sdp-attention is still not 100% image reproduction
@rmdtech Can you maybe help testing this: #11958
And note to all, disable checkpoint cache if you run out of RAM
Just tried based on that branch and the same error is occurring. Though, it does now error faster than before. And I have checkpoint caches set to 0 This error occurs on any SDXL based model, and changing VAE settings, as recommended by others hasn't helped either.
Here is my error log:
Launching Web UI with arguments: --opt-split-attention --medvram --no-half --no-half-vae --autolaunch --listen --api --cors-allow-origins=http://localhost:7860/ --enable-insecure-extension-access --xformers --disable-model-loading-ram-optimization Loading weights [bfea7e18e2] from C:\Users\WIN11GPU\stable-diffusion-webui\models\Stable-diffusion\absolutereality_v10.safetensors Creating model from config: C:\Users\WIN11GPU\stable-diffusion-webui\configs\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Loading VAE weights specified in settings: C:\Users\WIN11GPU\stable-diffusion-webui\models\VAE\sdxl_vae.safetensors Applying attention optimization: xformers... done. Model loaded in 5.0s (load weights from disk: 0.2s, create model: 0.9s, apply weights to model: 0.9s, load VAE: 0.5s, calculate empty prompt: 2.6s). Running on local URL: http://0.0.0.0:7860
To create a public link, set share=True
in launch()
.
Startup time: 23.9s (prepare environment: 9.9s, launcher: 0.2s, import torch: 3.5s, import gradio: 1.0s, setup paths: 0.8s, other imports: 0.9s, load scripts: 1.1s, initialize extra networks: 0.2s, create ui: 2.0s, gradio launch: 4.3s).
Loading weights [0f1b80cfe8] from C:\Users\WIN11GPU\stable-diffusion-webui\models\Stable-diffusion\dreamshaperXL10_alpha2Xl10.safetensors
Creating model from config: C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\configs\inference\sd_xl_base.yaml
creating model quickly: RuntimeError
Traceback (most recent call last):
File "C:\Users\WIN11GPU\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
self._bootstrap_inner()
File "C:\Users\WIN11GPU\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
self.run()
File "C:\Users\WIN11GPU\stable-diffusion-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, args)
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\ui_settings.py", line 272, in
Failed to create model quickly; will retry using slow method.
changing setting sd_model_checkpoint to dreamshaperXL10_alpha2Xl10.safetensors [0f1b80cfe8]: RuntimeError
Traceback (most recent call last):
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\shared.py", line 633, in set
self.data_labels[key].onchange()
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\call_queue.py", line 14, in f
res = func(*args, kwargs)
File "C:\Users\WIN11GPU\stable-diffusion-webui\webui.py", line 238, in
- https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors
- https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl_vae.safetensors
These two will produce 1024x1024 on 4-6gb, run with --lowvram --opt-sdp-attention / --xformers*.
--lowvram is slow, it is a memory efficiency tradeoff for speed. You can replace it with --medvram (middle-ground) or remove it entirely. More memory means larger pictures.
The original stability-ai repo does not use these optimizations, so their recommendations are higher.
*The latest xformers / opt-sdp-attention will make 100% the same pictures, everytime. So don't worry about its use case. There are 0 downsides.
i try to start SDXL model with this VAE and low params , unsuccessfully
What happens to memory usage in the task manager?
memory is going to be full filled and then automatic reset to another model.
@mooonwalker1983 Can you try --lowram --medvram so the checkpoint gets directly loaded to VRAM Oh and update to 1.5.1
@dhwz Just tried this and still getting the same issues. (This is on 1.5.1) (Though it did reduce my RAM usage)
@dhwz Just tried this and still getting the same issues. (This is on 1.5.1) (Though it did reduce my RAM usage)
same problem, CPU is AMD Ryzen 5600
@mooonwalker1983 just a guess, is swap (pagefile) disabled on your Windows? If yes try enabling it, If not can you maybe increase the size, running out of ideas.
@rmdtech you're on an AMD GPU? If not please try without --no-half
@dhwz Used to use an AMD GPU but recently upgraded, accidently copied that over when setting up. I have removed it, but unfortunately no luck. I've also already got pagefile enabled, with 12GB allocated
Also test on --lowvram (not --lowram) I'm definitely sure it can work on your machine. Could it be a driver issue of some sort?
@mooonwalker1983 just a guess, is swap (pagefile) disabled on your Windows? If yes try enabling it, If not can you maybe increase the size, running out of ideas.
@rmdtech you're on an AMD GPU? If not please try without --no-half
i enable auto mode for swap in Windows 10 and it works !!!!!! very very slowly but works!
@mooonwalker1983 speed should improve if --medvram is used? Also try sdp or sdp-no-mem setting in optimization settings
nice
Also test on --lowvram (not --lowram) I'm definitely sure it can work on your machine. Could it be a driver issue of some sort?
I've got the latest Nvidia drivers, but you're right, I can't see any reason why this wouldn't work. It works fine for non SDXL models, but anything SDXL based fails to load :/
@mooonwalker1983 speed should improve if --medvram is used? Also try sdp-no-mem setting in optimization
It really works. thank you for help me! can it be more faster ?
cat in park Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 3542161037, Size: 1024x1024, Model hash: 31e35c80fc, Model: sd_xl_base_1.0, Version: v1.5.1
Time taken: 32.9 sec.
Also test on --lowvram (not --lowram) I'm definitely sure it can work on your machine. Could it be a driver issue of some sort?
I've got the latest Nvidia drivers, but you're right, I can't see any reason why this wouldn't work. It works fine for non SDXL models, but anything SDXL based fails to load :/
the general problem was in swap file settings. it works in auto mode for windows os
Unfortunately, I've already got identical settings. Though might be because I need more space on my C:/ drive, since I run this on a VM, I'll try increasing the drive storage and will report back
I use old drivers ( see the pinned issue), didn't wanna risk vram being loaded to ram
@mooonwalker1983 speed should improve if --medvram is used? Also try sdp-no-mem setting in optimization
It really works. thank you for help me! can it be more faster ?
cat in park Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 3542161037, Size: 1024x1024, Model hash: 31e35c80fc, Model: sd_xl_base_1.0, Version: v1.5.1
Time taken: 32.9 sec.
I think that's close to what is possible right now, your GPU isn't the fastest. I'm getting similar results with my 2070Super ~38secs. Just remember the resolution is 4x of the 1.5 model. If you reduce resolution you'll get similar speed but bad quality.
@dhwz have you seen anywhere a model with the built-in fixed vae? Its a bit odd to suggest everyone use --no-half-vae
,
However, it was needed for the refiner if I remember correctly.
it is also the 0.9 vae, there may be a difference.
I had the same problem until A1111 started with the "old" parameters (--precision full --no-half), then changed to (--no-half-vae) and now the start works. Now the problems are others, but at least starts without errors (3080 Ti card)
@dhwz have you seen anywhere a model with the built-in fixed vae? Its a bit odd to suggest everyone use
--no-half-vae
, However, it was needed for the refiner if I remember correctly.nope, I've already asked if we can have an updated version of the fp16 VAE, right now we need to stay on the 0.9 VAE, but I haven't seen any big difference in results
This is ridicules!! I have 2 cards 1 RTX 4090 and other RTX 3090 i already test to run on both and i got the same error when it tries to load the xl model!! any idea how to solve this?
I solve it doing what what the user @ mooonwalker1983 , in the drive that is installed stale diffusion active the system manage size! and then for me it works!
@ClashSAN I've to correct my answer now someone pushed a SDXL 1.0 base model with baked in fp16 VAE https://civitai.com/models/117188/sdxlfixedvaefp16
Suspect I'm in the same boat, with 1.5.1 and all the requirements.txt installed. Although I'm on an EC2 - 16GB RAM, 12GB VRAM. As soon as I select SDXL from the checkpoints drop-down I wait a bit then the system runs out of RAM.
It appears fine for the first few seconds, then this is the last breath:
11243 ec2-user 20 0 37.6g 14.7g 776508 S 25.9 96.1 0:54.95 python3
From the console, memory use soars once this final line is printed:
To create a public link, set `share=True` in `launch()`.
Startup time: 60.8s (launcher: 43.3s, import torch: 4.5s, import gradio: 0.9s, setup paths: 1.1s, other imports: 0.9s, load scripts: 7.5s, create ui: 2.2s, gradio launch: 0.3s).
Calculating sha256 for /home/ec2-user/stable-diffusion-webui/models/Stable-diffusion/SDXL_fixedvae_fp16.safetensors: 9296259af7ae0baa53c724757e34e0a793a2825f842b3c5cf535304b4966e2e9
Loading weights [9296259af7] from /home/ec2-user/stable-diffusion-webui/models/Stable-diffusion/SDXL_fixedvae_fp16.safetensors
Creating model from config: /home/ec2-user/stable-diffusion-webui/repositories/generative-models/configs/inference/sd_xl_base.yaml
Net result is me stopping the EC2 instance to start it again. Uncertain what this "Creating model from config..." does.
That's probably not enough RAM for SDXL, you need a lot of RAM while the model is loading. Are you able to change launch parameters? If yes you could try --lowram
16GB RAM is probably not enough, can you try increasing your pagefile size like shown above.
Pagefiles for EC2 isn't "normal". Not saying I can't do it, but it even with --lowram 16GB didn't work. I'm expecting a lot of memory optimisations to make this stuff bearable.
I can confirm this is 100% a RAM issue, since I'm lucky enough to run this in a VM, I've simply allocated more RAM and that has resolved the issue. Running at 32GB has solved my issue.
Thank you all for your help
It's definitely much more RAM intensive, if the SDXL base model is already loaded an I've enabled checkpoint cache and then loading the refiner and afterwards another model I'm running OOM even with 64GB RAM.
FWIW latest ComfyUI does launch and renders some images with SDXL on my EC2. It will crash eventually - possibly RAM but doesn't take the VM with it - but as a comparison that one "works".
I have the same issues (1070 8GB - 32GB RAM). The weird thing is : yesterday it worked. Today i moved SD from HDD to NVME - old checkpoints work, but SDXL refuses to do... Installed from scratch, same problems, chagend pagefile to auto : same.
"edit* I realised the only difference was the drive, and the swapfile settings. I DISABLED the swapfile on the drive where A1111 is located -> now it works. Weird, but it does ;)
args: --xformers --no-half-vae --lowvram --theme=dark
I am on WSL and all it says is ./webui.sh: line 254: 2015 Killed "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
But if I do dmesg | grep "Killed process"
, it shows [ 2211.417415] Out of memory: Killed process 2290 (python3) total-vm:67397084kB, anon-rss:11204164kB, file-rss:0kB, shmem-rss:81920kB, UID:1000 pgtables:43300kB oom_score_adj:0
so definitely looks like an out of memory issue here...
Edit: following this guide on increasing memory helped. Works now! https://learn.microsoft.com/en-us/answers/questions/1296124/how-to-increase-memory-and-cpu-limits-for-wsl2-win
I downloaded SDXL 1.0 base, refiner, Lora and placed them where they should be. After firing up A1111, when I went to select SDXL1.0, it tries to load and reverts back to the previous 1.5 model.
System Spec: Ryzen 9 5950X 128GB DDR 3600 EVGA RTX 3090
Calculating sha256 for F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\SDXL\sd_xl_base_1.0.safetensors: 31e35c80fc4829d14f90153f4c74cd59c90b779f6afe05a74cd6120b893f7e5b
Loading weights [31e35c80fc] from F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\SDXL\sd_xl_base_1.0.safetensors
Failed to load checkpoint, restoring previous
Loading weights [d43ce53b9b] from F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\samaritan3dCartoon_v10.safetensors
Applying xformers cross attention optimization.
changing setting sd_model_checkpoint to SDXL\sd_xl_base_1.0.safetensors: RuntimeError
Traceback (most recent call last):
File "F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared.py", line 509, in set
self.data_labels[key].onchange()
File "F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\call_queue.py", line 15, in f
res = func(*args, **kwargs)
File "F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\webui.py", line 205, in
@thegreatsai you're not on latest webui?
@thegreatsai you're not on latest webui?
I am probably not. How do you manually update it? I didn't do a gitpull when I first installed it.
@thegreatsai you're not on latest webui?
I am probably not. How do you manually update it? I didn't do a gitpull when I first installed it.
I ended up doing another fresh install and moved over existing models and other stuff. SDXL1.0 does load now and works! :D
Same problem. Automatic1111 - Stable Diffusion Ver: 1.5.1. (Lastest). I'm on a RTX 3060Ti 8GB VRAM, 16GB RAM. I've tested 3 model's: " SDXL 1.0 Base - SDXL 1.0 Refiner & The Other SDXL Fp16 Baked VAE. None of them works.
I also desactivated all extensions & tryed to keep some after, dont work too. I Run WebUi-User.Bat Commands ARGS: "--no-half-vae" "--xformers" "--lowvram" It's don't work too.
Honestly idk. Memory issues ?
Also test on --lowvram (not --lowram) I'm definitely sure it can work on your machine. Could it be a driver issue of some sort?
I've got the latest Nvidia drivers, but you're right, I can't see any reason why this wouldn't work. It works fine for non SDXL models, but anything SDXL based fails to load :/
the general problem was in swap file settings. it works in auto mode for windows os
SOLVED THE ISSUE FOR ME AS WELL - THANK YOU
Set vm to automatic on windows
The same thing happened to me with the refiner, and after trying several arguments without success, I noticed that I had "Checkpoints to cache in RAM=2" configured, setting it to "0" I was able to get enough RAM (I have 32GB of RAM) to load the refiner. As others previously said, it's a RAM problem.
COMMANDLINE_ARGS= --disable-safe-unpickle --opt-sdp-attention --no-half-vae --medvram --xformers
I added swap to my EC2. I was able to switch to SDXL. Prior to running anything else, here's the top
listing for reference:
27618 ec2-user 20 0 37.9g 10.2g 118516 S 0.2 66.3 2:23.88 python3
Guys try to aolocate virtual ram in performance settings if you dont know what is this try search "adding virtual ram windows"
Is there an existing issue for this?
What happened?
I have install and update automatic1111, put SDXL model in models and it dont play, trying to start but failed. but It works in ComfyUI . RTX 4060TI 8 GB, 32 GB, Ryzen 5 5600
Steps to reproduce the problem
i dont know
What should have happened?
errors
Version or Commit where the problem happens
1.5.0
What Python version are you running on ?
Python 3.10.x
What platforms do you use to access the UI ?
Windows
What device are you running WebUI on?
Nvidia GPUs (RTX 20 above)
Cross attention optimization
Automatic
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
List of extensions
Console logs
Additional information
No response