SD001|用StabilityMatrix一鍵安裝Stable Diffusion-免費的AI圖像生成工具

Stable Diffusion是2022年發布的深度學習文字到圖像生成模型,它能免費使用,又能部署在本地端,又有非常多的模型可以直接套用,在使用體驗上比Midjourney和DALL-E更加強大。

先前Stable Diffusion的部署步驟有點繁複,必須安裝Python相關環境、Git執行環境等等,但現在透過StabilityMatrix只要執行一個StabilityMatrix.exe就可以了,它會自動下載需要的檔案與模型,並提供了圖形介面讓我們可以方便的控制多達 7 個Web UI,可以說StabilityMatrix大幅降低了Stable Diffusion的使用門檻。

本次介紹完整的StabilityMatrix安裝步驟。

[!INFO]+ StabilityMatrix 下載

1. 安裝步驟

  1. 解壓縮 StabilityMatrix-win-x64.zip 後執行StabilityMatrix.exe。在檢查到NVIDIA顯示卡後,勾選同意授權協議再按【Continue】

gh|500

  1. 勾選【Portable Mode】以建立可攜環境,運行環境會建立在執行檔相同位置的Data資料夾裡

gh|500

  1. 選擇Web UI,先使用最常見的Stable Diffusion WebUI,點擊【Install】

gh|700

開始安裝並下載需要的檔案...

gh|500

  1. 安裝完成後會顯示【Launch】頁面
  • 點擊三橫線顯示完整的側邊欄功能表
  • 點擊綠色的【Launch】就能啟動安裝好的Stable Diffusion WebUI
  • 【Launch】按鈕右側的齒輪可設定啟動參數
    gh|700
  1. 點擊【Packages】→【Add Package】可再新增其他的WebUI套件
    gh|700
  • 除了剛剛安裝好的Automatic1111以外,還有的 6 個WebUI套件可以安裝
    gh|700
  1. 第一次啟動(Launch)時會自動複製需要的檔案,其中預設的模型主檔 v1-5-pruned-emaonly.safetensors 有3.97GB,需要花點時間下載

gh|700

▼ 瀏覽器裡的Stable Diffusion WebUI
gh

2. 初次測試

  • State Diffusion checkpoint(大模型)選用預設的v1-5-pruned-emaonly.safetensors
  • 在txt2img分頁的【Prompt】(正面提示詞)輸入 a cute kitten
  • 【Negative Prompt】(負面提示詞)輸入 (worst quality:2),(low quality:2),(normal quality:2),lowres
    • 負面提示詞指示避免產生的屬性,括號裡可額外設定權重
  • 點擊【Generate】開始生成圖片。產生時StabilityMatrix.exe視窗會顯示執行記錄
  • 若出現NansException錯誤,在Launch參數→勾選【No Half】
    NansException: A tensor with all NaNs was produced in Unet. This could be either because there's not enough precision to represent the picture, or because your video card does not support half type. Try setting the "Upcast cross attention layer to float32" option in Settings > Stable Diffusion or using the --no-half commandline argument to fix this. Use --disable-nan-check commandline argument to disable this check.
  • 若發生CUDA記憶體不足→勾選 --lowvram

2.1. 生成結果

gh

3. 相關鏈接

4. 教學影片

##

您可能也會有興趣的類似文章

您可能也會喜歡…

2 個回應

  1. adamkang表示:

    感謝您的分享

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *