基本介紹
目前已經有很多 AI 繪圖模型。例如常聽過的Midjourney、Nijijourney
這些可以直接在 Discord 丟一些關鍵字來產生圖片,但缺點就是需要付費
當你產生的圖片超過這個月的免費使用額度就需要花錢來買額度。
而 Stable-Diffusion 你可以想像是把別人做的的模型拿來在自己電腦使用
所以可以無限制的產生圖片,目前安裝流程也已經很簡單了
安裝流程不到 30 分鐘即可完成(耗時間的都是在下載需要的套件)
安裝
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# 1. 安裝 Python 3.10.6 以上版本 # 2. 安裝 git # 3. git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git # 4. 修改 stable-diffusion-webui/webui-user.bat 如下,主要是設定 Python 執行檔位置 @echo off set PYTHON=C:Python310python.exe set GIT= set VENV_DIR=Jason_DIR set COMMANDLINE_ARGS= call webui.bat # 5. 執行 stable-diffusion-webuiwebui-user.bat (直接點即可,不需要用管理者權限),這邊需要下載需要的套件會久一點,大概 10~20 分鐘取決網路速度 # 6. 接下來預設會出現這個警告訊息,這是正常的,他是說目前找不到 model(模型)可以用 venv "D:stable-diffusion-webuiJason_DIRScriptsPython.exe" Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] Commit hash: 4af3ca5393151d61363c30eef4965e694eeac15e Installing requirements for Web UI Launching Web UI with arguments: No module 'xformers'. Proceeding without it. No checkpoints found. When searching for checkpoints, looked at: - file D:stable-diffusion-webuimodel.ckpt - directory D:stable-diffusion-webuimodelsStable-diffusion Can't run without a checkpoint. Find and place a .ckpt file into any of those locations. The program will exit. # 7. 所以我們現在就去下載模型,到這網頁 https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main 下載 v1-5-pruned.ckpt (7.7 GB) 放到 stable-diffusion-webuimodelsStable-diffusion 底下 # 8. 再執行一次 stable-diffusion-webuiwebui-user.bat 正常會出現類似以下文字 venv "D:stable-diffusion-webuiJason_DIRScriptsPython.exe" Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] Commit hash: 4af3ca5393151d61363c30eef4965e694eeac15e Installing requirements for Web UI Launching Web UI with arguments: No module 'xformers'. Proceeding without it. LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Loading weights [a9263745] from D:stable-diffusion-webuimodelsStable-diffusionv1-5-pruned.ckpt Applying cross attention optimization (Doggettx). Model loaded. Loaded a total of 0 textual inversion embeddings. Embeddings: Running on local URL: http://127.0.0.1:7860 To create a public link, set `share=True` in `launch()`. # 9. 瀏覽器貼上網址 : http://127.0.0.1:7860 出現以下畫面表示成功 |

|
1 2 |
# 10. 接著在 Prompt 中輸入 "a gentleman otter in a 19th century portrait" 再按下 "Generate" 即可產生圖片 |
