AUTOMATIC1111 / stable-diffusion-webui

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

[Bug]: OutOfMemoryError #15020

Open TheCryxh opened 9 months ago

TheCryxh commented 9 months ago

Checklist

What happened?

When I try to use txt2img, it says (because I have 2gb of vram)"OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF". My question is: is there a way to use CPU instead of GPU?

Steps to reproduce the problem

  1. Generate using txt2img

What should have happened?

WebUI should.. works

What browsers do you use to access the UI ?

Microsoft Edge

Sysinfo

image

Console logs

To create a public link, set `share=True` in `launch()`.
Creating model from config: C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\configs\v1-inference.yaml
Startup time: 16.2s (prepare environment: 3.2s, import torch: 5.5s, import gradio: 1.4s, setup paths: 1.5s, initialize shared: 0.3s, other imports: 0.9s, setup codeformer: 0.2s, load scripts: 1.8s, create ui: 0.8s, gradio launch: 0.6s).
loading stable diffusion model: OutOfMemoryError
Traceback (most recent call last):
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\initialize.py", line 147, in load_model
    shared.sd_model  # noqa: B018
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared_items.py", line 128, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 531, in get_sd_model
    load_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 4 more times]
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
    module._load_from_state_dict(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
    return torch.empty_strided(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Stable diffusion model failed to load
Applying attention optimization: Doggettx... done.
Loading weights [6ce0161689] from C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Exception in thread Thread-18 (load_model):
Traceback (most recent call last):
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\initialize.py", line 153, in load_model
    devices.first_time_calculation()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\devices.py", line 162, in first_time_calculation
    linear(x)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\extensions-builtin\Lora\networks.py", line 486, in network_Linear_forward
    return originals.Linear_forward(self, input)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\linear.py", line 114, in forward
    return F.linear(input, self.weight, self.bias)
RuntimeError: CUDA error: out of memory
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

Creating model from config: C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\configs\v1-inference.yaml
loading stable diffusion model: OutOfMemoryError
Traceback (most recent call last):
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks.py", line 419, in pages_html
    return refresh()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks.py", line 425, in refresh
    pg.refresh()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks_textual_inversion.py", line 13, in refresh
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\textual_inversion\textual_inversion.py", line 222, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\textual_inversion\textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared_items.py", line 128, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 531, in get_sd_model
    load_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 4 more times]
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
    module._load_from_state_dict(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
    return torch.empty_strided(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Stable diffusion model failed to load
Loading weights [6ce0161689] from C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Traceback (most recent call last):
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks.py", line 419, in pages_html
    return refresh()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks.py", line 425, in refresh
    pg.refresh()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks_textual_inversion.py", line 13, in refresh
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\textual_inversion\textual_inversion.py", line 222, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\textual_inversion\textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
AttributeError: 'NoneType' object has no attribute 'cond_stage_model'
Creating model from config: C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\configs\v1-inference.yaml
loading stable diffusion model: OutOfMemoryError
Traceback (most recent call last):
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks.py", line 419, in pages_html
    return refresh()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks.py", line 425, in refresh
    pg.refresh()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks_textual_inversion.py", line 13, in refresh
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\textual_inversion\textual_inversion.py", line 222, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\textual_inversion\textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared_items.py", line 128, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 531, in get_sd_model
    load_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 4 more times]
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
    module._load_from_state_dict(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
    return torch.empty_strided(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Stable diffusion model failed to load
Loading weights [6ce0161689] from C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Traceback (most recent call last):
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks.py", line 419, in pages_html
    return refresh()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks.py", line 425, in refresh
    pg.refresh()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui_extra_networks_textual_inversion.py", line 13, in refresh
    sd_hijack.model_hijack.embedding_db.load_textual_inversion_embeddings(force_reload=True)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\textual_inversion\textual_inversion.py", line 222, in load_textual_inversion_embeddings
    self.expected_shape = self.get_expected_shape()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\textual_inversion\textual_inversion.py", line 154, in get_expected_shape
    vec = shared.sd_model.cond_stage_model.encode_embedding_init_text(",", 1)
AttributeError: 'NoneType' object has no attribute 'cond_stage_model'
Creating model from config: C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\configs\v1-inference.yaml
loading stable diffusion model: OutOfMemoryError
Traceback (most recent call last):
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui.py", line 1143, in <lambda>
    update_image_cfg_scale_visibility = lambda: gr.update(visible=shared.sd_model and shared.sd_model.cond_stage_key == "edit")
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared_items.py", line 128, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 531, in get_sd_model
    load_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 4 more times]
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
    module._load_from_state_dict(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
    return torch.empty_strided(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Stable diffusion model failed to load
Loading weights [6ce0161689] from C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\configs\v1-inference.yaml
loading stable diffusion model: OutOfMemoryError
Traceback (most recent call last):
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\ui.py", line 1143, in <lambda>
    update_image_cfg_scale_visibility = lambda: gr.update(visible=shared.sd_model and shared.sd_model.cond_stage_key == "edit")
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared_items.py", line 128, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 531, in get_sd_model
    load_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 4 more times]
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
    module._load_from_state_dict(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
    return torch.empty_strided(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Stable diffusion model failed to load
Loading weights [6ce0161689] from C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\configs\v1-inference.yaml
loading stable diffusion model: OutOfMemoryError
Traceback (most recent call last):
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\call_queue.py", line 36, in f
    res = func(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\txt2img.py", line 16, in txt2img
    sd_model=shared.sd_model,
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared_items.py", line 128, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 531, in get_sd_model
    load_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 4 more times]
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
    module._load_from_state_dict(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
    return torch.empty_strided(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Stable diffusion model failed to load
Loading weights [6ce0161689] from C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\configs\v1-inference.yaml
Loading weights [6ce0161689] from C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
Creating model from config: C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\configs\v1-inference.yaml
loading stable diffusion model: OutOfMemoryError
Traceback (most recent call last):
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\processing.py", line 721, in process_images
    sd_models.reload_model_weights()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 783, in reload_model_weights
    load_model(checkpoint_info, already_loaded_state_dict=state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 4 more times]
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
    module._load_from_state_dict(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 226, in <lambda>
    conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
    return torch.empty_strided(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "C:\Users\thecr\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\call_queue.py", line 57, in f
    res = list(func(*args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\call_queue.py", line 36, in f
    res = func(*args, **kwargs)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\txt2img.py", line 55, in txt2img
    processed = processing.process_images(p)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\processing.py", line 737, in process_images
    sd_models.apply_token_merging(p.sd_model, 0)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\processing.py", line 238, in sd_model
    return shared.sd_model
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\shared_items.py", line 128, in sd_model
    return modules.sd_models.model_data.get_sd_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 531, in get_sd_model
    load_model()
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
    load_model_weights(sd_model, checkpoint_info, state_dict, timer)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
    model.load_state_dict(state_dict, strict=False)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
    module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
    original(module, state_dict, strict=strict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
    load(self, state_dict)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
    load(child, child_state_dict, child_prefix)
  [Previous line repeated 1 more time]
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
    module._load_from_state_dict(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 225, in <lambda>
    linear_load_from_state_dict = self.replace(torch.nn.Linear, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(linear_load_from_state_dict, *args, **kwargs))
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
    module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
    return aten.empty_like.default(
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
    return self._op(*args, **kwargs or {})
  File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
    return torch.empty_strided(
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

Stable diffusion model failed to load
*** Error completing request
*** Arguments: ('task(9g5hpmxf7gx2p9o)', 'fdff', '', [], 20, 'DPM++ 2M Karras', 1, 1, 7, 512, 512, False, 0.7, 2, 'Latent', 0, 0, 0, 'Use same checkpoint', 'Use same sampler', '', '', [], <gradio.routes.Request object at 0x000001BF74779B40>, 0, False, '', 0.8, -1, False, -1, 0, 0, 0, False, False, 'positive', 'comma', 0, False, False, 'start', '', 1, '', [], 0, '', [], 0, '', [], True, False, False, False, 0, False) {}
    Traceback (most recent call last):
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\call_queue.py", line 57, in f
        res = list(func(*args, **kwargs))
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\call_queue.py", line 36, in f
        res = func(*args, **kwargs)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\txt2img.py", line 55, in txt2img
        processed = processing.process_images(p)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\processing.py", line 721, in process_images
        sd_models.reload_model_weights()
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 783, in reload_model_weights
        load_model(checkpoint_info, already_loaded_state_dict=state_dict)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 658, in load_model
        load_model_weights(sd_model, checkpoint_info, state_dict, timer)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_models.py", line 375, in load_model_weights
        model.load_state_dict(state_dict, strict=False)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 223, in <lambda>
        module_load_state_dict = self.replace(torch.nn.Module, 'load_state_dict', lambda *args, **kwargs: load_state_dict(module_load_state_dict, *args, **kwargs))
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 221, in load_state_dict
        original(module, state_dict, strict=strict)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2027, in load_state_dict
        load(self, state_dict)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
        load(child, child_state_dict, child_prefix)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
        load(child, child_state_dict, child_prefix)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2015, in load
        load(child, child_state_dict, child_prefix)
      [Previous line repeated 4 more times]
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\nn\modules\module.py", line 2009, in load
        module._load_from_state_dict(
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 226, in <lambda>
        conv2d_load_from_state_dict = self.replace(torch.nn.Conv2d, '_load_from_state_dict', lambda *args, **kwargs: load_from_state_dict(conv2d_load_from_state_dict, *args, **kwargs))
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\modules\sd_disable_initialization.py", line 191, in load_from_state_dict
        module._parameters[name] = torch.nn.parameter.Parameter(torch.zeros_like(param, device=device, dtype=dtype), requires_grad=param.requires_grad)
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_meta_registrations.py", line 1780, in zeros_like
        return aten.empty_like.default(
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_ops.py", line 287, in __call__
        return self._op(*args, **kwargs or {})
      File "C:\Users\thecr\Desktop\stable-diffusion-webui-master\stable-diffusion-webui-master\venv\lib\site-packages\torch\_refs\__init__.py", line 4254, in empty_like
        return torch.empty_strided(
    torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 114.00 MiB (GPU 0; 2.00 GiB total capacity; 1.67 GiB already allocated; 0 bytes free; 1.72 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

---

Additional information

No response

Stellaris12 commented 9 months ago

edit` the webui-user.bat file and add --lowvram to the command line arguments the file should look like the code below.

`@echo off

set PYTHON= set GIT= set VENV_DIR= set COMMANDLINE_ARGS= --lowvram

call webui.bat`

fdefake commented 9 months ago

I ran in to the same issue, I ran .bat with argument --lowvram

fdefake commented 9 months ago

It didn't fix it, if you find an answer, please help!