升級 MacOS 14 Sonoma 後 StableDiffusion 不能運作

升級 MacOS 14 Sonoma 後 StableDiffusion 不能運作的兩個解決方法。

升級 MacOS 14 Sonoma 後 StableDiffusion 不能運作
升級 MacOS 14 Sonoma 後 StableDiffusion 不能運作

在我貪新鮮升級最新的 MacOS 14 Sonoma 後,發現 Automatic1111's StableDiffusionWebUI 不能順利生成圖片,情況跟這個 github issus 差不多。

就是可以順利打開 WebUI ,但是在生成圖片會有大量 Error message。

Python[13813:192227] ANE Evaluation Error = Error Domain=com.apple.appleneuralengine Code=8 "processRequest:model:qos:qIndex:modelStringID:options:error:: ANEProgramProcessRequestDirect() Failed with status=0x16 : statusType=0x9: Program Inference error" UserInfo={NSLocalizedDescription=processRequest:model:qos:qIndex:modelStringID:options:error:: ANEProgramProcessRequestDirect() Failed with status=0x16 : statusType=0x9: Program Inference error}

這情況下什麼生圖的動作也不能進行!


解決方法

  1. 首先安裝最新版的 torch
    pip3 install --upgrade --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
  2. 修改 webui-user.sh 如下
#!/bin/bash
#########################################################
# Uncomment and change the variables below to your need:#
#########################################################

# Install directory without trailing slash
#install_dir="/home/$(whoami)"

# Name of the subdirectory
#clone_dir="stable-diffusion-webui"

# Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention"
export COMMANDLINE_ARGS="--skip-torch-cuda-test --upcast-sampling --no-half-vae --use-cpu interrogate"

# python3 executable
#python_cmd="python3"

# git executable
#export GIT="git"

# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
#venv_dir="venv"

# script to launch to start the app
#export LAUNCH_SCRIPT="launch.py"

# install command for torch
export TORCH_COMMAND="pip install --pre torch==2.2.0.dev20231012 torchvision==0.17.0.dev20231012 --index-url https://download.pytorch.org/whl/nightly/cpu"

# Requirements file to use for stable-diffusion-webui
#export REQS_FILE="requirements_versions.txt"

# Fixed git repos
#export K_DIFFUSION_PACKAGE=""
#export GFPGAN_PACKAGE=""

# Fixed git commits
#export STABLE_DIFFUSION_COMMIT_HASH=""
#export CODEFORMER_COMMIT_HASH=""
#export BLIP_COMMIT_HASH=""

# Uncomment to enable accelerated launch
#export ACCELERATE="True"

# Uncomment to disable TCMalloc
#export NO_TCMALLOC="True"

###########################################

3. 做用以下指令重新啟動一次以更新 torch 版本 ./webui.sh --reinstall-torch

4. 然後系統會自動安裝並更新 torch 版本到 torch: 2.2.0.dev20231012 ,又可以順利重新出圖了。


若以上修改因為各種不因不行,還有一個簡單版的應急方法:

就是在啟動指令改為 ./webui.sh --half ,這樣你還是可以打開 UI 生成圖片,但是有時速度會比以前慢一點,所以還是建議用更新 torch 版本的方法。

Read more

Unity AI Assistant 2.7.0 將不再支援 MCP 連接

Unity AI Assistant 2.7.0 將不再支援 MCP 連接

相信有不少人用 Unity AI MCP 來連接 Claude Code / Codex 等 AI 工具進行開發,近日隨著 Unity AI 進入公測,Unity 官方 Package com.unity.ai.assistant 亦升級到 v2.7.0-pre.2 。這個新版本的 Unity AI Assistant 在 Unity MCP Server 上加上了限制,Connected Clients limit 在 0 個 direct connection(以前是 Unlimited),就是不讓開發者使用其他 AI 工具來支援開發。 官方也有說明可以怎樣做,

Game Engine 的選擇

Game Engine 的選擇

在前陣子在決定寫 game 的期間,我試用了三大主流 Game Engine 來實作 demo,現在比較一下 Unreal,Unity 及 Godot 適合什麼開發者。 自我定位 在開始選擇前,我首先要確定自己是什麼開發者,以什麼角度去選擇 Game Engine。 * 首先我是獨立開發者,就是一個人會負責所有東西,繪圖設計,故事劇情,程式開發,宣傳銷售,後續經營,所以簡單很重要。 * 我使用 Macbook Pro M1 來開發,由於我沒有 desktop,單靠效能有限的主機來開發,所以效能夠不夠對我來說也是很重要。 * 遊戲平台,我的初期目標是 Steam/Andriod/iOS,如果有成果才會推向各大主機,雖然三大 Game Engine 都支持多平台輸出,但實際上調查後發現還是有一些限制,我會在下面解釋。 * 遊戲類型,