MAC缓解WebUI提示词反推

当前环境信息:

在mac上安装好stable diffusion后,能做图片生成了之后,遇到一些图片需要做提示词反推,这个时候需要下载一个插件,参考:

https://gitcode.net/ranting8323/stable-diffusion-webui-wd14-tagger

安装完成后,可以在这个位置使用,这里是给了一个图片来反推提示词。

使用过程中遇到了一些错误记录如下:

Loading wd14-vit-v2-git model file from SmilingWolf/wd-v1-4-vit-tagger-v2

'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /SmilingWolf/wd-v1-4-vit-tagger-v2/resolve/main/model.onnx (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x1622bcc40>, 'Connection to huggingface.co timed out. (connect timeout=10)'))"), '(Request ID: 008f823b-7a19-4899-bbed-3bacbe0bfee2)')' thrown while requesting HEAD https://huggingface.co/SmilingWolf/wd-v1-4-vit-tagger-v2/resolve/main/model.onnx

这个错误是访问huggingface被拦截,需要科学上网。

还有一个错误,安装onnxruntime失败:

RuntimeError: Couldn't install onnxruntime.

Command: "/Users/xxxx/aigc/stable-diffusion-webui/venv/bin/python3" -m pip install onnxruntime-gpu --prefer-binary

Error code: 1

stdout: Looking in indexes: https://mirrors.aliyun.com/pypi/simple/

我这台电脑的解决方案是,修改webui的代码,如下:

文件名:interrogator.py

复制代码
    def load(self) -> None:
        model_path, tags_path = self.download()

        # only one of these packages should be installed at a time in any one environment
        # https://onnxruntime.ai/docs/get-started/with-python.html#install-onnx-runtime
        # TODO: remove old package when the environment changes?
        from launch import is_installed, run_pip
        if not is_installed('onnxruntime'):
            package = os.environ.get(
                'ONNXRUNTIME_PACKAGE',
#                 'onnxruntime-gpu'
                'onnxruntime'
            )

修改代码后重新启动 webui,就能正常的反推提示词了;

将反推的提示词重新生成图片,效果如下:

相关推荐
Naisu Xu1 天前
Mac上安装Homebrew、Git、Python等环境记录
git·python·macos·终端·brew
程序猿进阶1 天前
OpenClaw Mac 安装教程
java·macos·ai·架构·agent·openclaw
Rudon滨海渔村1 天前
macOS启动转换助理出现“不能下载该软件,因为网络出现问题 ”
网络·macos
一个人旅程~1 天前
mac-bootcamp的windows系统因升级intel驱动更新等升级驱动导致的功能异常故障?
windows·经验分享·macos·电脑
一块小土坷垃2 天前
# AutoCAD 2027 专业级CAD设计绘图软件核心解析与使用评价
macos·开源软件
Rudon滨海渔村2 天前
MacBookPro更换硬盘-重新安装macOS+Win10LTSC双系统-官方免费工具
macos
一块小土坷垃2 天前
# ArchiCAD 29.0.2(畅享版):专为建筑师打造的BIM高效建模工具
前端·数据库·macos·开源软件
代码讲故事2 天前
mac电脑上docker突然无法运行,不停的出现弹框,“com.docker.vmnetd”将对你的电脑造成伤害。附国内不同芯片高速下载地址,下载直接运行。
macos·docker·容器·arm·mac·intel·下载
一块小土坷垃2 天前
## CleanMyMac – macOS 强大的系统清理与优化工具
macos·开源软件
秋雨梧桐叶落莳3 天前
iOS——ZARA仿写项目
学习·macos·ios·objective-c·cocoa