目次
利用cup来运行stable diffusion
如许你在用运行时就不会报这个几个错误:
问题一:ERROR: Could not find a version that satisfies the requirement torch==1.13.1+cu117(from versions: none)。 torchvision==0.14.1+cu117
问题二: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:\Users\xxxx\AppData\Roaming\pip\pip.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-webui\venv\Scripts这个位置,运行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。访问不了报错的。因为要下载里面的大模子很耗时的。
原网址 https://huggingface.co/openai/clip-vit-large-patch14/tree/mainhttps://huggingface.co/openai/clip-vit-large-patch14/tree/main国内镜像
魔塔社区不消登录就可以下载的
魔搭社区汇聚各领域最先进的机器学习模子,提供模子探索体验、推理、训练、部署和应用的一站式服务。https://www.modelscope.cn/models/AI-ModelScope/clip-vit-large-patch14/files
这个要登录的
互链高科huggingface镜像,提供HuggingFace.co资源下载,为AI开辟者提供模子镜像加速服务,通过下载器可以达到10M/s的下载速度,解决大模子下载时间长、经常断线等问题,实现镜像加速、断点续传、无人值守下载https://plus.gitclone.com/models/openai/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
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |