ComfyUI 輕鬆轉換不同 Style

有用過 Fooocus 的用家都會覺得可以隨意選擇風格很方便,不用每次自己設定 prompts,其實在 ComfyUI 也可以安裝 SDXL Prompt Styler 來實現。

ComfyUI 輕鬆轉換不同 Style
ComfyUI 輕鬆轉換不同 Style

有用過 Fooocus 的用家都會覺得可以隨意選擇風格很方便,不用每次自己設定 prompts,其實在 ComfyUI 也可以安裝 SDXL Prompt Styler 來實現。


安裝 SDXL Prompt Styler

  • 在 ComfyUI 目錄打開 teriminal
  • 進入 ComfyUI/custom_nodes 資料夾
  • 用 git 下載文件 git clone https://github.com/twri/sdxl_prompt_styler.git
  • 啟動/重新啟動 ComfyUI
GitHub - twri/sdxl_prompt_styler: Custom prompt styler node for SDXL in ComfyUI
Custom prompt styler node for SDXL in ComfyUI. Contribute to twri/sdxl_prompt_styler development by creating an account on GitHub.

使用方法

新增 SDXL Prompt Styler node
  • Add Node > utils > SDXL Prompt Styler
SDXL Prompt Styler

第一個方格是自訂的 prompt,第二個方格是自訂的 negative prompt,style 是選擇不同的風格 base 是沒有風格。也可以將 prompt 及 negative prompt 轉成經 node 輸入,右 click SDXL Prompt Styler,選擇 Convert text_positive to input 及 Convert text_negatice to input。

將 prompt 轉成 input

新增 Primitive Node

  • Add Node > utils > Primitive
新增 Primitive Node

將 Primitive Node 連到 text_positive input 就會變成 string,可輸入 prompt。

連到 text_positive
prompt 及 negative prompt 各一即可
將 SDXL Prompt Styler 加入到整個流程

想使用以上 workflow 可以下載以下 file。

想了解更多風格可以參考這篇,我有為每一個風格生成參考圖。

簡易版 StableDiffusionWebUI - Fooocus
StableDiffusionWebUI 雖然功能強大,但更多人喜歡 Midjourney 單純用 prompt 的簡易操作方式。StableDiffusionWebUI 最具代表性的 extension - ControlNet 的作者 lllyasviel 重新構思 Stable Diffusion 後推出了這個新軟件 Fooocus。

自訂風格

如果有一些喜歡的風格 prompt 其實也可以在 SDXL Prompt Styler 中加入自訂風格,方便記錄及以後重用。

開一個新.json file
  • 首先在 ComfyUI/custom_nodes/sdxl_prompt_styler/ 資料夾中生增一個新的 json 檔,我將此 file 命名為 sdxl_styles_edmond.json。
加入原創的 prompt
  • 然後依以上格式加入 prompt, name 是在 node 中顯示的名稱, prompt 就是主要 prompt,當中的 {prompt} 是指在 node input 的 prompt。 negative_prompt 就是 negative prompt。
  • 儲存後重啟 ComfyUI。
在 style 中即可以選擇新自訂的 style
  • 然後在 SDXL Prompt Styler 中就可以選擇新的 style 了。
使用自訂的 style 生成圖片

總結

有 SDXL Prompt Styler 後可以更簡單生成不同風格的圖片,可以節省很多找風格 prompt 的時間。

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 都支持多平台輸出,但實際上調查後發現還是有一些限制,我會在下面解釋。 * 遊戲類型,