目录
问题二:Installing gfpgan,等了半个多小时一直卡着不动了。
问题三:RuntimeError: cannot import name ‘_compare_version’ from ‘torchmetrics.utilities.imports’
问题四:OSError: Can’t load tokenizer for ‘openai/clip-vit-large-patch14’. If you we
前提python,和git要安装上。python要安装3.10.x版本的最好是3.10.6。(github上的SD仓库推荐的,我看到是),不然容易报各种未知问题。pip版本升级也可能失败。
如果你下载的别人安装好的的SD安装包,那最好是问问别人用的什么版本的python。会少很多的麻烦。
pip你可以配置一下国内镜像。这个博客
Python配置国内镜像源_python更换镜像源-CSDN博客
这是全局环境变量配置
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
C:UsersxxxxAppDataRoamingpippip.ini。没有就创建pip.ini
可以配置多个
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
extra-index-url =
https://pypi.tuna.tsinghua.edu.cn/simple/
https://pypi.douban.com/simple/
https://pypi.mirrors.ustc.edu.cn/simple/
https://pypi.org/simple
[install]
trusted-host =
mirrors.aliyun.com
pypi.tuna.tsinghua.edu.cn
pypi.douban.com
pypi.mirrors.ustc.edu.cn
pypi.org
使用cup来运行stable diffusion
运行前 的环境配置。windows在webui-user.bat,Linux或者MAC在webui-user.sh里面
因为没有GPU,只能用CPU去跑模型,所以要在,webui-user.bat文件里配置变量,只配置这两个就可以了。
set CUDA_VISIBLE_DEVICES =-1 #将gpu设置为不可见
set COMMANDLINE_ARGS= --use-cpu all --no-half --precision full --skip-torch-cuda-test --listen
Linux或者MAC在webui-user.sh
export CUDA_VISIBLE_DEVICES =-1 #将gpu设置为不可见
export COMMANDLINE_ARGS= --use-cpu all --no-half --precision full --skip-torch-cuda-test --listen
这样你在用运行时就不会报这个几个错误:
1.
AssertionError: Torch is not able to use GPU; add –skip-torch-cuda-test to COMMANDLINE_ARGS variable to disable this check。没有检测到GPU,咱们在环境变量里加入–skip-torch-cuda-test,表示跳过该测试。
2.
AssertionError: Torch not compiled with CUDA enabled
问题一:ERROR: Could not find a version that satisfies the requirement torch==1.13.1+cu117(from versions: none)。 torchvision==0.14.1+cu117
这个因为网络或域外镜像问题可能会下载失败,你可以通过离线安装,这个是下载网址
torch:https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp310-cp310-win_amd64.whl
torchvision:http://download.pytorch.org/whl/cu117/torchvision-0.14.1%2Bcu117-cp310-cp310-win_amd64.whl
你点击webui-user.bat,运行后后再webui-user.bat同级文件夹里创建出一个venv文件夹,进入stable-diffusion-webuivenvScripts这个位置,运行cmd,输入这个命令activate,进入到python虚拟环境,离线安装torch,torchvision。
pip install torch-1.13.1+cu117-cp310-cp310-win_amd64.whl
pip install torchvision-0.14.1+cu117-cp310-cp310-win_amd64.whl
安装好后从新运行webui-user.bat。
问题二:Installing gfpgan,等了半个多小时一直卡着不动了。
直接去官网下载下来https://github.com/TencentARC/GFPGAN,压缩包或git clone都可以。
放到和webui-user.bat同级目录中把,要是压缩包就解压。同时把名字改成gfpgan。注意小写的。
这样就行了。再次从新运行webui-user.bat。就会走到下一步 clip。这个两个得多等会儿才行。有些慢几分钟。
Installing clip
Installing open_clip
问题三:RuntimeError: cannot import name ‘_compare_version’ from ‘torchmetrics.utilities.imports’
stable diffusion 遇到的问题 – zxddesk – 博客园
找的最简单的,我自己用了有效。就是把torchmetrics==0.11.4放到 requirements.txt 或 requirements_version.txt.文件里就可以了。同时放入也可以的。就不会报错了。
也可以试试这个
1、输入pip show torchmetrics
2、卸载torchmetrics
pip uninstall torchmetrics
3、下载0.11.4版本的torchmetrics
pip install torchmetrics==0.11.4
再次运行webui-user.bat。
问题四:OSError: Can’t load tokenizer for ‘openai/clip-vit-large-patch14’. If you we
这个就是因为是外网要下载clip-vit-large-patch14。访问不了报错的。因为要下载里面的大模型很耗时的。
魔塔社区不用登录就可以下载的
这个要登录的
还有最简单的办法。亲测有效。
就是去gihub上找这个clip-vit-large-patch14的仓库,克隆git clone或下载压缩包到本地来(最好是下载压缩包)。在webui-user.bat同级目录里创建一个文件夹叫做openai,把clip-vit-large-patch14克隆git clone或下载压缩包放到openai里面。是压缩包就解压放进去。
然后你在跑就没问题了。不需要下载模型文件。你也可以一下载模型。
你安装完成后,运行时可能提醒需要安装.NET 6.0 Desktop Runtime。6.0桌面运行程序。
这是下载地址https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/sdk-6.0.413-windows-x64-installer
最后就可以运行了。

反向词
DeepNegative,EasyNegativeV2,bad-hands-5,bad_prompt_version2,deformed,missing limbs,amputated,disfigured,poorly drawn face,mutation,mutated,ugly,disgusting,oversaturated,doubled face,b&w,black and white,sepia,freckles,no masks,duplicate image,paintings,sketches,(worst quality:2),(low quality:2),(normal quality:2),lowres,monochrome,grayscale,bad anatomy,(fat:1.2),tilted head,bad hands,error,missing fingers,extra digit,fewer digits,cropped,blurry,bad feet,jpeg (artifacts:1.2),
canvas frame, (high contrast:1.2), (over saturated:1.2), (glossy:1.1), ((disfigured)), ((bad art)), ((b&w)), blurry, ((bad anatomy)), (((bad proportions))), ((extra limbs)), cloned face, (((disfigured))), extra limbs, (bad anatomy), gross proportions, (malformed limbs), ((missing arms)), ((missing legs)), (((extra arms))), (((extra legs))), mutated hands, (fused fingers), (too many fingers), (((long neck))), photoshop, video game, ugly, tiling, poorly drawn hands, (nsfw:1.2), nude, naked, pink nipples
正向词(参考)
high quality 3d rendering high resolution raytracing
(front focus),(in the dark:1.6),
(masterpiece:1.1),(highest quality:1.1),(HDR:1),ambient light,ultra-high quality,( ultra detailed original illustration),
film grain and (medium full shot:1.2) and 8K HD RAW photo
注意:我的环境是内网没有网络。文生图是没问题的。但是GFPGAN(gfpgan)、CodeFormer、Upscaler 1和Upscaler 2竟然不能用
AttributeError: ‘NoneType’ object has no attribute ‘local_data_path’。
无语。我觉得除了网络外,有些文件能用git 克隆下来就克隆下来。git clone https:xxxxxxx.git
文章来源于互联网:Intel显卡,Stable diffusion安装过程中遇到的问题。
5bei.cn大模型教程网
https://huggingface.co/openai/clip-vit-large-patch14/tree/main










