赞
踩
brew install cmake protobuf rust python@3.10 git wget
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
当然,这一步可以选择是在本机或者是在移动硬盘上进行clone,我选择的是移动硬盘上
安装好miniconda后,创建新的虚拟环境
conda create -n sdenv python=3.11
注意,这里在选择python版本的时候最好要大于3.10
安装后
conda activate sdenv
MacBook-Pro stable-diffusion-webui % python --version
Python 3.11.8
cd stable-diffusion-webui
./webui.sh
正常来说,等待安装结束即可。
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 37: invalid start byte
Traceback (most recent call last):
File "/Volumes/T7/stable-diffusion-webui/launch.py", line 48, in <module>
main()
File "/Volumes/T7/stable-diffusion-webui/launch.py", line 39, in main
prepare_environment()
File "/Volumes/T7/stable-diffusion-webui/modules/launch_utils.py", line 380, in prepare_environment
run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
File "/Volumes/T7/stable-diffusion-webui/modules/launch_utils.py", line 115, in run
raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/Volumes/T7/stable-diffusion-webui/venv/bin/python3" -m pip install torch==2.1.0 torchvision==0.16.0
Error code: 1
直接更改为conda环境,webui.sh中搜索create,将199-224行激活虚拟环境的代码注释掉。
Commit hash: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5
Cloning assets into /Volumes/T7/stable-diffusion-webui/repositories/stable-diffusion-webui-assets...
Cloning into '/Volumes/T7/stable-diffusion-webui/repositories/stable-diffusion-webui-assets'...
fatal: unable to access 'https://github.com/AUTOMATIC1111/stable-diffusion-webui-assets.git/': Failure when receiving data from the peer
Traceback (most recent call last):
File "/Volumes/T7/stable-diffusion-webui/launch.py", line 48, in <module>
main()
File "/Volumes/T7/stable-diffusion-webui/launch.py", line 39, in main
prepare_environment()
File "/Volumes/T7/stable-diffusion-webui/modules/launch_utils.py", line 410, in prepare_environment
git_clone(assets_repo, repo_dir('stable-diffusion-webui-assets'), "assets", assets_commit_hash)
File "/Volumes/T7/stable-diffusion-webui/modules/launch_utils.py", line 191, in git_clone
run(f'"{git}" clone --config core.filemode=false "{url}" "{dir}"', f"Cloning {name} into {dir}...", f"Couldn't clone {name}", live=True)
File "/Volumes/T7/stable-diffusion-webui/modules/launch_utils.py", line 115, in run
raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't clone assets.
Command: "git" clone --config core.filemode=false "https://github.com/AUTOMATIC1111/stable-diffusion-webui-assets.git" "/Volumes/T7/stable-diffusion-webui/repositories/stable-diffusion-webui-assets"
可以使用更加稳定的网络重新执行,或者将命令复制出来,重新执行。
cd repositories
git clone --config core.filemode=false "https://github.com/AUTOMATIC1111/stable-diffusion-webui-assets.git"
当然,也可以使用一些github加速网站,下载后再将包放到对应文件夹下。
OSError: Can't load tokenizer for 'openai/clip-vit-large-patch14'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'openai/clip-vit-large-patch14' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
openai/clip-vit-large-patch14
,然后将它替换为你刚刚下载的文件夹a即可。 File "/Volumes/T7/stable-diffusion-webui/modules/sd_disable_initialization.py", line 221, in load_state_dict
original(module, state_dict, strict=strict)
File "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2139, in load_state_dict
load(self, state_dict)
File "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2127, in load
load(child, child_state_dict, child_prefix)
File "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2127, in load
load(child, child_state_dict, child_prefix)
File "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2127, in load
load(child, child_state_dict, child_prefix)
[Previous line repeated 3 more times]
File "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2121, in load
module._load_from_state_dict(
File "/Volumes/T7/stable-diffusion-webui/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 "/Volumes/T7/stable-diffusion-webui/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 "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/_meta_registrations.py", line 4806, in zeros_like
res = aten.empty_like.default(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/_ops.py", line 513, in __call__
return self._op(*args, **(kwargs or {}))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/_prims_common/wrappers.py", line 250, in _fn
result = fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/Users/kimm/anaconda3/envs/sdenv/lib/python3.11/site-packages/torch/_refs/__init__.py", line 4755, in empty_like
return torch.empty_permuted(
^^^^^^^^^^^^^^^^^^^^^
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.
只需要在执行webui.sh脚本的时候加上--disable-model-loading-ram-optimization
参数接口。
./webui.sh --disable-model-loading-ram-optimization
至此,安装成功,大家就可以愉快的使用啦~当然后续也会将我配置好的包放上来,可以期待哦~
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。