hako-mikan / sd-webui-supermerger

model merge extention for stable diffusion web ui
GNU Affero General Public License v3.0
703 stars 104 forks source link

supermerger won't load #350

Closed CHNtentes closed 3 months ago

CHNtentes commented 4 months ago

root@b5ee504db119:/stable-diffusion-webui# python3 webui.py --port 7863 no module 'xformers'. Processing without... no module 'xformers'. Processing without... No module 'xformers'. Proceeding without it. *** Error loading script: GenParamGetter.py Traceback (most recent call last): File "/stable-diffusion-webui/modules/scripts.py", line 319, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 848, in exec_module File "", line 219, in _call_with_frames_removed File "/stable-diffusion-webui/extensions/sd-webui-supermerger/scripts/GenParamGetter.py", line 3, in from scripts.mergers.mergers import smergegen, simggen File "/stable-diffusion-webui/extensions/sd-webui-supermerger/scripts/mergers/mergers.py", line 691, in def extract_super(base: Tensor | None, a: Tensor, b: Tensor, alpha: float, beta: float, gamma: float) -> Tensor: TypeError: unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'NoneType'


*** Error loading script: supermerger.py Traceback (most recent call last): File "/stable-diffusion-webui/modules/scripts.py", line 319, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module module_spec.loader.exec_module(module) File "", line 848, in exec_module File "", line 219, in _call_with_frames_removed File "/stable-diffusion-webui/extensions/sd-webui-supermerger/scripts/supermerger.py", line 22, in import scripts.mergers.mergers File "/stable-diffusion-webui/extensions/sd-webui-supermerger/scripts/mergers/mergers.py", line 691, in def extract_super(base: Tensor | None, a: Tensor, b: Tensor, alpha: float, beta: float, gamma: float) -> Tensor: TypeError: unsupported operand type(s) for |: 'torch._C._TensorMeta' and 'NoneType'


Loading weights [72bd94132e] from /stable-diffusion-webui/models/Stable-diffusion/127631.safetensors Running on local URL: http://0.0.0.0:7863

To create a public link, set share=True in launch(). Startup time: 4.5s (import torch: 1.6s, import gradio: 0.8s, setup paths: 0.4s, other imports: 0.8s, load scripts: 0.4s, create ui: 0.5s).

CHNtentes commented 4 months ago

webui version is 1.5.1 and supermerger is latest

CHNtentes commented 4 months ago

Solved. For Python version < 3.10, use

from typing import Union
def extract_super(base: Union[Tensor, None], a: Tensor, b: Tensor, alpha: float, beta: float, gamma: float) -> Tensor:

instead.

design61 commented 3 months ago

How did you fix this?My version information is: python: 3.10.7  •  torch: 2.2.0+cu121  •  xformers: 0.0.24  •  gradio: 3.41.2

celluuuu commented 3 months ago

@CHNtentes @design61 how to fix it for Python version > 3.10 ?

hako-mikan commented 3 months ago

As mentioned by @CHNtentes This issue would not occur if Python 3.10 or later is used, and since the web-ui requires the installation of Python 3.10 or later, this problem should not normally arise. However, it's not a difficult change to make, so I've modified it to work with earlier versions as well.