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

[Bug]: SDXL 1.0 model don't starts #12081

Closed
1 task done
mooonwalker1983 opened this issue Jul 27, 2023 · 54 comments
Closed
1 task done

[Bug]: SDXL 1.0 model don't starts #12081

mooonwalker1983 opened this issue Jul 27, 2023 · 54 comments
Labels
bug-report Report of a bug, yet to be confirmed sdxl Related to SDXL

Comments

@mooonwalker1983
Copy link

mooonwalker1983 commented Jul 27, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

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

image

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

@echo off

set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=--xformers --autolaunch --theme dark

call webui.bat

List of extensions

image

Console logs

venv "F:\sd.webui\webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.5.0
Commit hash: a3ddf464a2ed24c999f67ddfef7969f8291567be




Checking Roop-GE requirements...
Done!


Launching Web UI with arguments: --xformers --autolaunch --theme dark
[-] ADetailer initialized. version: 23.7.9, num models: 9
2023-07-27 12:52:17,990 - ControlNet - INFO - ControlNet v1.1.233
ControlNet preprocessor location: F:\sd.webui\webui\extensions\sd-webui-controlnet\annotator\downloads
2023-07-27 12:52:18,075 - ControlNet - INFO - ControlNet v1.1.233
sd-webui-prompt-all-in-one background API service started successfully.
2023-07-27 12:52:18,731 - Roop-GE - INFO - Roop-GE v0.2.2
2023-07-27 12:52:18,732 - Roop-GE - INFO - Roop-GE v0.2.2
Loading weights [e9d3cedc4b] from F:\sd.webui\webui\models\Stable-diffusion\1.Realism\realisticVisionV40_v40VAE.safetensors
add tab
Creating model from config: F:\sd.webui\webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Loading VAE weights specified in settings: F:\sd.webui\webui\models\VAE\vae-ft-mse-840000-ema-pruned.safetensors
Applying attention optimization: xformers... done.
Model loaded in 3.7s (load weights from disk: 0.9s, create model: 0.5s, apply weights to model: 0.7s, apply half(): 0.4s, load VAE: 0.5s, move model to device: 0.6s).
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 19.4s (launcher: 5.3s, import torch: 3.1s, import gradio: 0.8s, setup paths: 0.7s, other imports: 1.0s, load scripts: 3.7s, create ui: 1.4s, gradio launch: 2.9s, app_started_callback: 0.3s).
Loading weights [31e35c80fc] from F:\sd.webui\webui\models\Stable-diffusion\SDXL\sd_xl_base_1.0.safetensors
Creating model from config: F:\sd.webui\webui\repositories\generative-models\configs\inference\sd_xl_base.yaml
Failed to create model quickly; will retry using slow method.
changing setting sd_model_checkpoint to SDXL\sd_xl_base_1.0.safetensors [31e35c80fc]: RuntimeError
Traceback (most recent call last):
  File "F:\sd.webui\webui\modules\shared.py", line 633, in set
    self.data_labels[key].onchange()
  File "F:\sd.webui\webui\modules\call_queue.py", line 14, in f
    res = func(*args, **kwargs)
  File "F:\sd.webui\webui\webui.py", line 238, in <lambda>
    shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()), call=False)
  File "F:\sd.webui\webui\modules\sd_models.py", line 578, in reload_model_weights
    load_model(checkpoint_info, already_loaded_state_dict=state_dict)
  File "F:\sd.webui\webui\modules\sd_models.py", line 504, in load_model
    sd_model = instantiate_from_config(sd_config.model)
  File "F:\sd.webui\webui\repositories\stable-diffusion-stability-ai\ldm\util.py", line 89, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "F:\sd.webui\webui\repositories\generative-models\sgm\models\diffusion.py", line 61, in __init__
    self.conditioner = instantiate_from_config(
  File "F:\sd.webui\webui\repositories\generative-models\sgm\util.py", line 175, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "F:\sd.webui\webui\repositories\generative-models\sgm\modules\encoders\modules.py", line 88, in __init__
    embedder = instantiate_from_config(embconfig)
  File "F:\sd.webui\webui\repositories\generative-models\sgm\util.py", line 175, in instantiate_from_config
    return get_obj_from_str(config["target"])(**config.get("params", dict()))
  File "F:\sd.webui\webui\repositories\generative-models\sgm\modules\encoders\modules.py", line 428, in __init__
    model, _, _ = open_clip.create_model_and_transforms(
  File "F:\sd.webui\webui\venv\lib\site-packages\open_clip\factory.py", line 308, in create_model_and_transforms
    model = create_model(
  File "F:\sd.webui\webui\venv\lib\site-packages\open_clip\factory.py", line 192, in create_model
    model = CLIP(**model_cfg, cast_dtype=cast_dtype)
  File "F:\sd.webui\webui\venv\lib\site-packages\open_clip\model.py", line 203, in __init__
    text = _build_text_tower(embed_dim, text_cfg, quick_gelu, cast_dtype)
  File "F:\sd.webui\webui\venv\lib\site-packages\open_clip\model.py", line 170, in _build_text_tower
    text = TextTransformer(
  File "F:\sd.webui\webui\venv\lib\site-packages\open_clip\transformer.py", line 543, in __init__
    self.transformer = Transformer(
  File "F:\sd.webui\webui\venv\lib\site-packages\open_clip\transformer.py", line 304, in __init__
    self.resblocks = nn.ModuleList([
  File "F:\sd.webui\webui\venv\lib\site-packages\open_clip\transformer.py", line 305, in <listcomp>
    ResidualAttentionBlock(
  File "F:\sd.webui\webui\modules\sd_hijack_utils.py", line 17, in <lambda>
    setattr(resolved_obj, func_path[-1], lambda *args, **kwargs: self(*args, **kwargs))
  File "F:\sd.webui\webui\modules\sd_hijack_utils.py", line 26, in __call__
    return self.__sub_func(self.__orig_func, *args, **kwargs)
  File "F:\sd.webui\webui\modules\sd_hijack_unet.py", line 76, in <lambda>
    CondFunc('open_clip.transformer.ResidualAttentionBlock.__init__', lambda orig_func, *args, **kwargs: kwargs.update({'act_layer': GELUHijack}) and False or orig_func(*args, **kwargs), lambda _, *args, **kwargs: kwargs.get('act_layer') is None or kwargs['act_layer'] == torch.nn.GELU)
  File "F:\sd.webui\webui\venv\lib\site-packages\open_clip\transformer.py", line 211, in __init__
    ("c_fc", nn.Linear(d_model, mlp_width)),
  File "F:\sd.webui\webui\venv\lib\site-packages\torch\nn\modules\linear.py", line 96, in __init__
    self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
RuntimeError: [enforce fail at ..\c10\core\impl\alloc_cpu.cpp:72] data. DefaultCPUAllocator: not enough memory: you tried to allocate 26214400 bytes.

Additional information

No response

@mooonwalker1983 mooonwalker1983 added the bug-report Report of a bug, yet to be confirmed label Jul 27, 2023
@wzgrx
Copy link
Contributor

wzgrx commented Jul 27, 2023

The minimum graphics memory requirement for SDX 1.0 is 12GB+

@mooonwalker1983
Copy link
Author

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
hiresfix_721888757315279_0001

@Myoko
Copy link

Myoko commented Jul 27, 2023

needed 12G VRAM, 8G cannot start 😒😒

@ClashSAN
Copy link
Collaborator

@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

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

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

@rmdtech
Copy link

rmdtech commented Jul 27, 2023

I am having the exact same issue with a RTX 3060 12GB and 24GB System RAM

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

@rmdtech Can you maybe help testing this: #11958

And note to all, disable checkpoint cache if you run out of RAM

@ClashSAN
Copy link
Collaborator

ClashSAN commented Jul 27, 2023

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
Copy link

rmdtech commented Jul 27, 2023

@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
fn=lambda value, k=k: self.run_settings_single(value, key=k),
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\ui_settings.py", line 90, in run_settings_single
if not opts.set(key, value):
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
shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()), call=False)
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\sd_models.py", line 582, in reload_model_weights
load_model(checkpoint_info, already_loaded_state_dict=state_dict)
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\sd_models.py", line 498, in load_model
sd_model = instantiate_from_config(sd_config.model)
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\util.py", line 89, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\models\diffusion.py", line 61, in init
self.conditioner = instantiate_from_config(
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\util.py", line 175, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\modules\encoders\modules.py", line 88, in init
embedder = instantiate_from_config(embconfig)
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\util.py", line 175, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\modules\encoders\modules.py", line 428, in init
model, _, _ = open_clip.create_model_and_transforms(
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\sd_disable_initialization.py", line 65, in create_model_and_transforms_without_pretrained
return self.create_model_and_transforms(*args, pretrained=None, **kwargs)
File "C:\Users\WIN11GPU\stable-diffusion-webui\venv\lib\site-packages\open_clip\factory.py", line 308, in create_model_and_transforms
model = create_model(
File "C:\Users\WIN11GPU\stable-diffusion-webui\venv\lib\site-packages\open_clip\factory.py", line 192, in create_model
model = CLIP(**model_cfg, cast_dtype=cast_dtype)
File "C:\Users\WIN11GPU\stable-diffusion-webui\venv\lib\site-packages\open_clip\model.py", line 203, in init
text = _build_text_tower(embed_dim, text_cfg, quick_gelu, cast_dtype)
File "C:\Users\WIN11GPU\stable-diffusion-webui\venv\lib\site-packages\open_clip\model.py", line 170, in _build_text_tower
text = TextTransformer(
File "C:\Users\WIN11GPU\stable-diffusion-webui\venv\lib\site-packages\open_clip\transformer.py", line 541, in init
self.token_embedding = nn.Embedding(vocab_size, width)
File "C:\Users\WIN11GPU\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\sparse.py", line 142, in init
self.weight = Parameter(torch.empty((num_embeddings, embedding_dim), **factory_kwargs),
RuntimeError: [enforce fail at ..\c10\core\impl\alloc_cpu.cpp:72] data. DefaultCPUAllocator: not enough memory: you tried to allocate 252968960 bytes.

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
shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()), call=False)
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\sd_models.py", line 582, in reload_model_weights
load_model(checkpoint_info, already_loaded_state_dict=state_dict)
File "C:\Users\WIN11GPU\stable-diffusion-webui\modules\sd_models.py", line 507, in load_model
sd_model = instantiate_from_config(sd_config.model)
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\stable-diffusion-stability-ai\ldm\util.py", line 89, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\models\diffusion.py", line 50, in init
model = instantiate_from_config(network_config)
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\util.py", line 175, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\modules\diffusionmodules\openaimodel.py", line 753, in init
SpatialTransformer(
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\modules\attention.py", line 588, in init
[
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\modules\attention.py", line 589, in
BasicTransformerBlock(
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\modules\attention.py", line 426, in init
self.ff = FeedForward(dim, dropout=dropout, glu=gated_ff)
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\modules\attention.py", line 100, in init
else GEGLU(dim, inner_dim)
File "C:\Users\WIN11GPU\stable-diffusion-webui\repositories\generative-models\sgm\modules\attention.py", line 85, in init
self.proj = nn.Linear(dim_in, dim_out * 2)
File "C:\Users\WIN11GPU\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\linear.py", line 96, in init
self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
RuntimeError: [enforce fail at ..\c10\core\impl\alloc_cpu.cpp:72] data. DefaultCPUAllocator: not enough memory: you tried to allocate 13107200 bytes.

@mooonwalker1983
Copy link
Author

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

image

@ClashSAN
Copy link
Collaborator

What happens to memory usage in the task manager?

@mooonwalker1983
Copy link
Author

memory is going to be full filled and then automatic reset to another model.
image

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

@mooonwalker1983 Can you try --lowram --medvram so the checkpoint gets directly loaded to VRAM
Oh and update to 1.5.1

@rmdtech
Copy link

rmdtech commented Jul 27, 2023

@dhwz Just tried this and still getting the same issues. (This is on 1.5.1) (Though it did reduce my RAM usage)

@mooonwalker1983
Copy link
Author

@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
image

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

@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

@rmdtech
Copy link

rmdtech commented Jul 27, 2023

@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

@ClashSAN
Copy link
Collaborator

ClashSAN commented Jul 27, 2023

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
Copy link
Author

@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!
image

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

@mooonwalker1983 speed should improve if --medvram is used? Also try sdp or sdp-no-mem setting in optimization settings

@ClashSAN
Copy link
Collaborator

nice

@rmdtech
Copy link

rmdtech commented Jul 27, 2023

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
Copy link
Author

@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.

@mooonwalker1983
Copy link
Author

mooonwalker1983 commented Jul 27, 2023

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
image

@rmdtech
Copy link

rmdtech commented Jul 27, 2023

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

@ClashSAN
Copy link
Collaborator

I use old drivers ( see the pinned issue), didn't wanna risk vram being loaded to ram

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

@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.

@ClashSAN
Copy link
Collaborator

ClashSAN commented Jul 27, 2023

@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.

@paolodalprato
Copy link

paolodalprato commented Jul 27, 2023

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
Copy link
Contributor

dhwz commented Jul 27, 2023

@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

@merecesarchviz
Copy link

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?

image

@merecesarchviz
Copy link

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!

image

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

@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

@jmkgreen
Copy link

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.

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

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

@jmkgreen
Copy link

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.

@rmdtech
Copy link

rmdtech commented Jul 27, 2023

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

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

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.

@jmkgreen
Copy link

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".

@PennywiseDev
Copy link

PennywiseDev commented Jul 27, 2023

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 ;)

@blkc
Copy link

blkc commented Jul 27, 2023

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

@thegreatsai
Copy link

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

image

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
shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()))
File "F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 518, in reload_model_weights
load_model_weights(sd_model, checkpoint_info, state_dict, timer)
File "F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 286, in load_model_weights
model.load_state_dict(state_dict, strict=False)
File "F:\StableDiffusion\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2041, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for LatentDiffusion:
size mismatch for model.diffusion_model.input_blocks.4.1.proj_in.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([640, 640, 1, 1]).
size mismatch for model.diffusion_model.input_blocks.4.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([640, 768]).
size mismatch for model.diffusion_model.input_blocks.4.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([640, 768]).
size mismatch for model.diffusion_model.input_blocks.4.1.proj_out.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([640, 640, 1, 1]).
size mismatch for model.diffusion_model.input_blocks.5.1.proj_in.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([640, 640, 1, 1]).
size mismatch for model.diffusion_model.input_blocks.5.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([640, 768]).
size mismatch for model.diffusion_model.input_blocks.5.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([640, 768]).
size mismatch for model.diffusion_model.input_blocks.5.1.proj_out.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([640, 640, 1, 1]).
size mismatch for model.diffusion_model.input_blocks.7.1.proj_in.weight: copying a param with shape torch.Size([1280, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.input_blocks.7.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([1280, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.input_blocks.7.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([1280, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.input_blocks.7.1.proj_out.weight: copying a param with shape torch.Size([1280, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.input_blocks.8.1.proj_in.weight: copying a param with shape torch.Size([1280, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.input_blocks.8.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([1280, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.input_blocks.8.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([1280, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.input_blocks.8.1.proj_out.weight: copying a param with shape torch.Size([1280, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.middle_block.1.proj_in.weight: copying a param with shape torch.Size([1280, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.middle_block.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([1280, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.middle_block.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([1280, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.middle_block.1.proj_out.weight: copying a param with shape torch.Size([1280, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.2.0.in_layers.0.weight: copying a param with shape torch.Size([1920]) from checkpoint, the shape in current model is torch.Size([2560]).
size mismatch for model.diffusion_model.output_blocks.2.0.in_layers.0.bias: copying a param with shape torch.Size([1920]) from checkpoint, the shape in current model is torch.Size([2560]).
size mismatch for model.diffusion_model.output_blocks.2.0.in_layers.2.weight: copying a param with shape torch.Size([1280, 1920, 3, 3]) from checkpoint, the shape in current model is torch.Size([1280, 2560, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.2.0.skip_connection.weight: copying a param with shape torch.Size([1280, 1920, 1, 1]) from checkpoint, the shape in current model is torch.Size([1280, 2560, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.3.0.in_layers.0.weight: copying a param with shape torch.Size([1920]) from checkpoint, the shape in current model is torch.Size([2560]).
size mismatch for model.diffusion_model.output_blocks.3.0.in_layers.0.bias: copying a param with shape torch.Size([1920]) from checkpoint, the shape in current model is torch.Size([2560]).
size mismatch for model.diffusion_model.output_blocks.3.0.in_layers.2.weight: copying a param with shape torch.Size([640, 1920, 3, 3]) from checkpoint, the shape in current model is torch.Size([1280, 2560, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.3.0.in_layers.2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.0.emb_layers.1.weight: copying a param with shape torch.Size([640, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.3.0.emb_layers.1.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.0.out_layers.0.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.0.out_layers.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.0.out_layers.3.weight: copying a param with shape torch.Size([640, 640, 3, 3]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.3.0.out_layers.3.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.0.skip_connection.weight: copying a param with shape torch.Size([640, 1920, 1, 1]) from checkpoint, the shape in current model is torch.Size([1280, 2560, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.3.0.skip_connection.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.norm.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.norm.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.proj_in.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.3.1.proj_in.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn1.to_q.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn1.to_k.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn1.to_v.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn1.to_out.0.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn1.to_out.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.ff.net.0.proj.weight: copying a param with shape torch.Size([5120, 640]) from checkpoint, the shape in current model is torch.Size([10240, 1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.ff.net.0.proj.bias: copying a param with shape torch.Size([5120]) from checkpoint, the shape in current model is torch.Size([10240]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.ff.net.2.weight: copying a param with shape torch.Size([640, 2560]) from checkpoint, the shape in current model is torch.Size([1280, 5120]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.ff.net.2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn2.to_q.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn2.to_out.0.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.attn2.to_out.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.norm1.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.norm1.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.norm2.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.norm2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.norm3.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.transformer_blocks.0.norm3.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.3.1.proj_out.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.3.1.proj_out.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.0.in_layers.0.weight: copying a param with shape torch.Size([1280]) from checkpoint, the shape in current model is torch.Size([2560]).
size mismatch for model.diffusion_model.output_blocks.4.0.in_layers.0.bias: copying a param with shape torch.Size([1280]) from checkpoint, the shape in current model is torch.Size([2560]).
size mismatch for model.diffusion_model.output_blocks.4.0.in_layers.2.weight: copying a param with shape torch.Size([640, 1280, 3, 3]) from checkpoint, the shape in current model is torch.Size([1280, 2560, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.4.0.in_layers.2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.0.emb_layers.1.weight: copying a param with shape torch.Size([640, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.4.0.emb_layers.1.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.0.out_layers.0.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.0.out_layers.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.0.out_layers.3.weight: copying a param with shape torch.Size([640, 640, 3, 3]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.4.0.out_layers.3.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.0.skip_connection.weight: copying a param with shape torch.Size([640, 1280, 1, 1]) from checkpoint, the shape in current model is torch.Size([1280, 2560, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.4.0.skip_connection.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.norm.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.norm.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.proj_in.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.4.1.proj_in.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn1.to_q.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn1.to_k.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn1.to_v.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn1.to_out.0.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn1.to_out.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.ff.net.0.proj.weight: copying a param with shape torch.Size([5120, 640]) from checkpoint, the shape in current model is torch.Size([10240, 1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.ff.net.0.proj.bias: copying a param with shape torch.Size([5120]) from checkpoint, the shape in current model is torch.Size([10240]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.ff.net.2.weight: copying a param with shape torch.Size([640, 2560]) from checkpoint, the shape in current model is torch.Size([1280, 5120]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.ff.net.2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn2.to_q.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn2.to_out.0.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.attn2.to_out.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.norm1.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.norm1.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.norm2.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.norm2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.norm3.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.transformer_blocks.0.norm3.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.4.1.proj_out.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.4.1.proj_out.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.0.in_layers.0.weight: copying a param with shape torch.Size([960]) from checkpoint, the shape in current model is torch.Size([1920]).
size mismatch for model.diffusion_model.output_blocks.5.0.in_layers.0.bias: copying a param with shape torch.Size([960]) from checkpoint, the shape in current model is torch.Size([1920]).
size mismatch for model.diffusion_model.output_blocks.5.0.in_layers.2.weight: copying a param with shape torch.Size([640, 960, 3, 3]) from checkpoint, the shape in current model is torch.Size([1280, 1920, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.5.0.in_layers.2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.0.emb_layers.1.weight: copying a param with shape torch.Size([640, 1280]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.5.0.emb_layers.1.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.0.out_layers.0.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.0.out_layers.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.0.out_layers.3.weight: copying a param with shape torch.Size([640, 640, 3, 3]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.5.0.out_layers.3.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.0.skip_connection.weight: copying a param with shape torch.Size([640, 960, 1, 1]) from checkpoint, the shape in current model is torch.Size([1280, 1920, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.5.0.skip_connection.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.norm.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.norm.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.proj_in.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.5.1.proj_in.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn1.to_q.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn1.to_k.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn1.to_v.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn1.to_out.0.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn1.to_out.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.ff.net.0.proj.weight: copying a param with shape torch.Size([5120, 640]) from checkpoint, the shape in current model is torch.Size([10240, 1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.ff.net.0.proj.bias: copying a param with shape torch.Size([5120]) from checkpoint, the shape in current model is torch.Size([10240]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.ff.net.2.weight: copying a param with shape torch.Size([640, 2560]) from checkpoint, the shape in current model is torch.Size([1280, 5120]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.ff.net.2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn2.to_q.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn2.to_k.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn2.to_v.weight: copying a param with shape torch.Size([640, 2048]) from checkpoint, the shape in current model is torch.Size([1280, 768]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn2.to_out.0.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.attn2.to_out.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.norm1.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.norm1.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.norm2.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.norm2.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.norm3.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.transformer_blocks.0.norm3.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.1.proj_out.weight: copying a param with shape torch.Size([640, 640]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.5.1.proj_out.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.5.2.conv.weight: copying a param with shape torch.Size([640, 640, 3, 3]) from checkpoint, the shape in current model is torch.Size([1280, 1280, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.5.2.conv.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.6.0.in_layers.0.weight: copying a param with shape torch.Size([960]) from checkpoint, the shape in current model is torch.Size([1920]).
size mismatch for model.diffusion_model.output_blocks.6.0.in_layers.0.bias: copying a param with shape torch.Size([960]) from checkpoint, the shape in current model is torch.Size([1920]).
size mismatch for model.diffusion_model.output_blocks.6.0.in_layers.2.weight: copying a param with shape torch.Size([320, 960, 3, 3]) from checkpoint, the shape in current model is torch.Size([640, 1920, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.6.0.in_layers.2.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.6.0.emb_layers.1.weight: copying a param with shape torch.Size([320, 1280]) from checkpoint, the shape in current model is torch.Size([640, 1280]).
size mismatch for model.diffusion_model.output_blocks.6.0.emb_layers.1.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.6.0.out_layers.0.weight: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.6.0.out_layers.0.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.6.0.out_layers.3.weight: copying a param with shape torch.Size([320, 320, 3, 3]) from checkpoint, the shape in current model is torch.Size([640, 640, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.6.0.out_layers.3.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.6.0.skip_connection.weight: copying a param with shape torch.Size([320, 960, 1, 1]) from checkpoint, the shape in current model is torch.Size([640, 1920, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.6.0.skip_connection.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.7.0.in_layers.0.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.7.0.in_layers.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([1280]).
size mismatch for model.diffusion_model.output_blocks.7.0.in_layers.2.weight: copying a param with shape torch.Size([320, 640, 3, 3]) from checkpoint, the shape in current model is torch.Size([640, 1280, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.7.0.in_layers.2.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.7.0.emb_layers.1.weight: copying a param with shape torch.Size([320, 1280]) from checkpoint, the shape in current model is torch.Size([640, 1280]).
size mismatch for model.diffusion_model.output_blocks.7.0.emb_layers.1.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.7.0.out_layers.0.weight: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.7.0.out_layers.0.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.7.0.out_layers.3.weight: copying a param with shape torch.Size([320, 320, 3, 3]) from checkpoint, the shape in current model is torch.Size([640, 640, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.7.0.out_layers.3.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.7.0.skip_connection.weight: copying a param with shape torch.Size([320, 640, 1, 1]) from checkpoint, the shape in current model is torch.Size([640, 1280, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.7.0.skip_connection.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.8.0.in_layers.0.weight: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([960]).
size mismatch for model.diffusion_model.output_blocks.8.0.in_layers.0.bias: copying a param with shape torch.Size([640]) from checkpoint, the shape in current model is torch.Size([960]).
size mismatch for model.diffusion_model.output_blocks.8.0.in_layers.2.weight: copying a param with shape torch.Size([320, 640, 3, 3]) from checkpoint, the shape in current model is torch.Size([640, 960, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.8.0.in_layers.2.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.8.0.emb_layers.1.weight: copying a param with shape torch.Size([320, 1280]) from checkpoint, the shape in current model is torch.Size([640, 1280]).
size mismatch for model.diffusion_model.output_blocks.8.0.emb_layers.1.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.8.0.out_layers.0.weight: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.8.0.out_layers.0.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.8.0.out_layers.3.weight: copying a param with shape torch.Size([320, 320, 3, 3]) from checkpoint, the shape in current model is torch.Size([640, 640, 3, 3]).
size mismatch for model.diffusion_model.output_blocks.8.0.out_layers.3.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).
size mismatch for model.diffusion_model.output_blocks.8.0.skip_connection.weight: copying a param with shape torch.Size([320, 640, 1, 1]) from checkpoint, the shape in current model is torch.Size([640, 960, 1, 1]).
size mismatch for model.diffusion_model.output_blocks.8.0.skip_connection.bias: copying a param with shape torch.Size([320]) from checkpoint, the shape in current model is torch.Size([640]).

@dhwz
Copy link
Contributor

dhwz commented Jul 27, 2023

@thegreatsai you're not on latest webui?

@thegreatsai
Copy link

@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
Copy link

@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

@MK499
Copy link

MK499 commented Jul 27, 2023

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 ?

@utheartist
Copy link

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 image

SOLVED THE ISSUE FOR ME AS WELL - THANK YOU

Set vm to automatic on windows

@cuajoneta
Copy link

cuajoneta commented Jul 28, 2023

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

image

@jmkgreen
Copy link

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

@akx akx added the sdxl Related to SDXL label Jul 31, 2023
@KoholSzkodzi
Copy link

Guys try to aolocate virtual ram in performance settings if you dont know what is this try search "adding virtual ram windows"

@JxinBain
Copy link

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 image

thanks so much.it's work.

@catboxanon
Copy link
Collaborator

1.6.0-RC should have resolved this. Also see the wiki for more information: https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Optimum-SDXL-Usage

@arafatx
Copy link

arafatx commented Oct 5, 2023

The minimum graphics memory requirement for SDX 1.0 is 12GB+

Let's help stop this misinformation floating around the internet 👌🙂

SDXL 1.0 doesn't need 12GB+

SDXL 1.0 works just fine with 8GB RAM. But if you're using it with the AUTOMATIC1111 UI, then yeah, you'll need 12GB+

@catboxanon
Copy link
Collaborator

catboxanon commented Oct 5, 2023

The wiki already explains that. 4GB even works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed sdxl Related to SDXL
Projects
None yet
Development

No branches or pull requests