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

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

相关推荐
黑化旺仔2 天前
【OC】KVO
macos·ios·objective-c·cocoa
Liekkas Kono2 天前
macOS 27 安装 VMware Fusion 和 Win11 经验
macos·win11·vmware
shark-chili4 天前
关于AI辅助编程的认知
数据库·人工智能·redis·macos·缓存
zwd20054 天前
Mac 上写英文遇到不会的词,有哪些工具?输入法、翻译软件、写作助手怎么选
人工智能·macos·效率工具·英语写作·输入法·deepl·翻译工具
33三 三like4 天前
Jx-Mac 本地部署过程总结
macos
大象AI共学5 天前
想在手机上读 Obsidian?Mac → iPhone / 安卓的零成本方案
macos·智能手机·iphone
sysinside6 天前
如何创建可引导的 macOS Golden Gate 27 安装介质
macos
Dr.Buho6 天前
macOS 27 升级教程:兼容机型、三种安装方法与降级提示
经验分享·macos
sysinside6 天前
macOS Golden Gate 27.0 (26A428) 正式版 Boot ISO 原版可引导映像下载
macos
黑科技iOS上架7 天前
Cocos应用App Store4.3被拒怎么自查
macos·ios·objective-c·cocoa·审核·ios混淆·cocos混淆