Repository: stable-diffusion-webui
Issue: [Bug]: VRAM CUDA
Labels: not-an-issue

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

After switching to torch 2, I can't generate even in the smallest format and can't roll back..

### Steps to reproduce the problem

And every other time CUDA errors appear

NotImplementedError: No operator found for `memory_efficient_attention_forward` with inputs: query : shape=(2, 4096, 8, 40) (torch.float16) key : shape=(2, 4096, 8, 40) (torch.float16) value : shape=(2, 4096, 8, 40) (torch.float16) attn_bias : <class 'NoneType'> p : 0.0 `cutlassF` is not supported because: xFormers wasn't build with CUDA support `flshattF` is not supported because: xFormers wasn't build with CUDA support `tritonflashattF` is not supported because: xFormers wasn't build with CUDA support triton is not available requires A100 GPU `smallkF` is not supported because: xFormers wasn't build with CUDA support dtype=torch.float16 (supported: {torch.float32}) max(query.shape[-1] != value.shape[-1]) > 32 unsupported embed per head: 40

### What should have happened?

Generation occurs

### Commit where the problem happens

At the time of generation

### What platforms do you use to access the UI ?

Windows

### What browsers do you use to access the UI ?

Microsoft Edge

### Command Line Arguments

```Shell
--medvram --always-batch-cond- --api --no-half --no-half --xformers --force-enable-xformers (I did a replacement with --opt-sdp-attention and --opt-sdp-attention, nothing changed)
```


### List of extensions

ControlNet


### Console logs
Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\21charturnerv2.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding 21charturnerv2.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\bad-artist-anime.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding bad-artist-anime.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\bad-artist.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding bad-artist.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\bad-hands-5.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding bad-hands-5.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\bad-image-v2-39000.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding bad-image-v2-39000.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\bad-picture-chill-75v.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding bad-picture-chill-75v.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\badhandv4.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding badhandv4.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\bad_prompt.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding bad_prompt.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\bad_prompt_version2.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding bad_prompt_version2.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\charturnerv2.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding charturnerv2.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\HyperStylizeV6.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding HyperStylizeV6.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\nartfixer.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding nartfixer.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\nfixer.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding nfixer.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\ng_deepnegative_v1_75t.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding ng_deepnegative_v1_75t.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\nrealfixer.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding nrealfixer.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\pureerosface_v1.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding pureerosface_v1.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\ulzzang-6500-v1.1.bin:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding ulzzang-6500-v1.1.bin:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable

Error verifying pickled file from E:\SD DEFUSION\stable-diffusion-webui\embeddings\ulzzang-6500.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 132, in load_with_extra
    check_pt(filename, extra_handler)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 90, in check_pt
    unpickler.load()
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\safe.py", line 27, in persistent_load
    return TypedStorage(_internal=True)
TypeError: TypedStorage.__new__() got an unexpected keyword argument '_internal'


The file may be malicious, so the program is not going to read it.
You can skip this check with --disable-safe-unpickle commandline argument.


Error loading embedding ulzzang-6500.pt:
Traceback (most recent call last):
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 210, in load_from_dir
    self.load_from_file(fullfn, fn)
  File "E:\SD DEFUSION\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 168, in load_from_file
    if 'string_to_param' in data:
TypeError: argument of type 'NoneType' is not iterable


### Additional information

_No response_