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,就能正常的反推提示词了;

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

相关推荐
焦虑的二狗15 小时前
Mac下载mysql
数据库·mysql·macos
通域19 小时前
Mac (m1) Java 加载本地C共享库函数 .dylib 函数 Unable to load library ‘liblicense‘
java·python·macos
至善迎风21 小时前
深入理解 macOS 的 quarantine、xattr 与 Gatekeeper
macos
marconiho1 天前
FRP Ubuntu 服务端 + MacOS 客户端配置
linux·ubuntu·macos
sagima_sdu1 天前
MacBook Air M4 安装 VMware Fusion Pro
jvm·macos
Magnetic_h1 天前
【iOS】方法与消息底层分析
笔记·学习·macos·ios·objective-c·cocoa
xchenhao1 天前
基于 Flutter 的开源文本 TTS 朗读器(支持 Windows/macOS/Android)
android·windows·flutter·macos·openai·tts·朗读器
IT WorryFree2 天前
macos安装iper3
网络·macos·iperf·打流
pk_xz1234562 天前
在Intel Mac的PyCharm中设置‘add bin folder to the path‘的解决方案
ide·人工智能·科技·算法·macos·pycharm·机器人
Fine姐3 天前
传感器WSNs TheDataLinkLayer——X-MAC
macos