AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
135.05k stars 25.8k forks source link

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

Closed mooonwalker1983 closed 10 months ago

mooonwalker1983 commented 11 months ago

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

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

JxinBain commented 10 months ago

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 commented 10 months ago

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 commented 9 months ago

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 commented 9 months ago

The wiki already explains that. 4GB even works.