在 ComfyUI 中做用 Stable Diffusion 3
在 Stable Diffusion 3 推出 API 後,雖然我也有介紹過用 Colab 連接 Stable Diffusion 3 API 的方法,但是習慣做用本地生成工具的大家也許不習慣做用 Colab,所以就為大家帶來 ComfyUI 的做用方法。

在 Stable Diffusion 3 推出 API 後,雖然我也有介紹過用 Colab 連接 Stable Diffusion 3 API 的方法,但是習慣做用本地生成工具的大家也許不習慣做用 Colab,所以就為大家帶來 ComfyUI 的做用方法。
還沒用過 ComfyUI 的話可以參考 ComfyUI 的安裝方法

安裝 ComfyUI-SAI_API
今次需要使用 Stability AI 官方推出的 node 來連接 Stable Diffusion 3 API。
在 ComfyUI Manager 內 install Custom Nodes 搜尋 Stability API 就可以找到 Stability API nodes for ComfyUI 這個 node。

在 Stability AI platform 上登入並取得 API Key

打開 ComfyUI 運行並使用 Stability API node,在 prompt
框輸入 prompts,n_prompt
框輸入 negative prompts,在 model 記得選 sd3 等於使用 Stable Diffusion 3, sd3 turbo 等於使用 Stable Diffusion 3 Turbo Model,在 API Key 中輸入上面在 Stablility AI platform 取得的 API key。

Stable Diffusion 3 大約需時 10 秒, Stable Diffusion 3 Turbo 大約需時 6 秒,即可生成高質的 Stable Diffusion 3 圖片。
不過 Stable Diffusion 3 的 API 是需要 credits 的。用完一開始送的免費 credits 後就要 USD $10 來買 1000 個 creaits。
- 每次成功用 SD3 生成一張
1024 x 1024
的圖片需要 6.5 個 credits。 - 每次成功用 SD3 Turbo 生成一張
1024 x 1024
的圖片需要 4 個 credits。 - 生成失敗的話是不會消耗 credits 的。
以下是我測試使用 Stable Diffusion 3 生成不同風格的圖片






Stable Diffusuon 3 (圖片由 Edmond Yip 生成)
今次 Stability AI 推出 ComfyUI node,令各個使用者可以更簡單的使用 Stability AI 的 API,某程度正在消除大家對使用 API 的障礙,未來這些大型 Model 都未必有下載版本使用,可能都的要靠 API 來使用。