當(dāng)前環(huán)境信息:
在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被攔截,需要科學(xué)上網(wǎng)。
還有一個錯誤,安裝onnxruntime失?。?/p>
? ? 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,就能正常的反推提示詞了;
將反推的提示詞重新生成圖片,效果如下:?文章來源:http://www.zghlxwxcb.cn/news/detail-763078.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-763078.html
到了這里,關(guān)于MAC緩解WebUI提示詞反推的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!