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

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

相关推荐
xUxIAOrUIII3 小时前
日常笔记-1005-1
linux·笔记·python·macos
传奇开心果编程6 小时前
【Compose Multiplatform 跨端开发学与练】第9课 测试与调试
android·学习·macos·ios·kotlin·web·composer
supabc1238 小时前
Celium:连接 Windows、Mac、Linux 与 Android,让远程访问和设备管理更简单
android·linux·windows·macos·远程访问·网络管理·celium
牛奔8 小时前
Mac 精准安装指定 macOS 版本完整教程(升级 + 降级通用)
macos
海盗12348 小时前
AI 新闻日报 2026-10-05:三周重构 30 万行 / macOS 给智能体加权限锁 / 具身订单结构被摆上台面
人工智能·macos·重构·机器人·人工智能aigc
青柠之夏cc1 天前
Kotlin Multiplatform:一次编写,全平台运行,2026 年跨平台开发的 “最优解”?
macos·objective-c·cocoa
黑科技iOS上架2 天前
iOS framework/dylib动态库定向加固实战
macos·ios·objective-c·cocoa·审核·ios混淆·执行程序差异化
神奇的小猴程序员3 天前
苹果Mac电脑玩我的世界没有版本?用PCL-R即可!
macos
灵韵aura3 天前
macOS 的指令缩写
macos
yqj2345 天前
ESP32-S3中小智项目优化内容
ide·macos·xcode