105826.jpg

Leader Three

【白嫖】SD-webui 網絡在綫部署之三 Paperspace 篇

姊妹篇:
【白嫖】SD-webui 網絡在綫部署之一 Google Colab 篇
https://blue-plus.net/read.php?tid-1757174.html
【白嫖】SD-webui 網絡在綫部署之二 Kaggle 篇
https://blue-plus.net/read.php?tid-1773624.html
【白嫖】SD-webui 網絡在綫部署之三 Paperspace 篇(本篇)
https://blue-plus.net/read.php?tid-1755458.html


目錄
++【前言】
++【創建Paperspace賬號】
++【建立Project/Notebook項目】
++【啓動終端,複製代碼】
++【初期設定,修改代碼】
++【模型設定,添加代碼】
++【啓動代碼】
++【啓動webui】

【前言】
Google Colab優點是快。
缺點是,挂機一段時間會斷連,超過時間會封。

Paperspace缺點是慢,免費GPU是專業卡Quadro M4000 8GB,核心GM204,相當於970。
優點是,沒有超出時間封號的危險。
但是,一次啓動時間有6小時,6小時自動停止,冷卻1小時,冷卻後可以繼續使用。
也就是說,一天大概可以18+小時。
當然不可能這麽極限,而且還要看網速,免費GPU是要搶的,沒搶到就乾看。
所以,其實差不多。


【創建Paperspace賬號】
https://www.paperspace.com/
首先,注冊,用Google賬戶或者Github賬戶注冊,這就不多贅述了。
然後,可能有手機驗證碼,也不多説了。
上面兩步,可能需要翻梯子。
signin登錄,應該就不需要了。

105826.jpg

Leader Three

下面正式開始~
省流文字版:
【建立Project/Notebook項目】
已經創建好賬號。
在最初的畫面右上,有按鈕「CREATE A PROJECT」,建立一個項目。
名字隨便,自動生成的也行。
在PROJECT界面,Notebooks頁,點擊中間紅色「CREATE」。如果已經有一個存在就是右上「CREATE」。建立一個Notebook記事冊。

「Select a runtime」運行時選擇「Start from Scratch」。
爲啥不要PyTorchTensorFlowStableDiffusion?
因爲我們要用別人的現成的代碼和庫,那些不全。

「Select a machine」機器選擇「Free-GPU」,免費GPU。
GPU有可能是灰的,那麽等一會,刷新。或者等人少的時候。還有像我上面説的網速。也可以試試梯子,換自己的IP。
所以點這個的優先級最高,其他選項可以往後稍稍。

「Auto-shutdown timeout」自動停止時間改爲6小時

「Advanced options」高級選項就不需要了。
不要浪費網速和時間。
趕緊點紅色「START NOTEBOOK」按鈕。

【啓動終端,複製代碼】
現在,進入了我們所創建的notebook界面。
點左側標簽的Jupyter朱庇特icon,也就是那個橙黃色的圈圈或框框。「Open in JupyterLab」。

進入更底層的Jupyter編輯界面。
在中間窗口的「Others」下面,點「Terminal」終端。
輸入代碼:
wget https://raw.githubusercontent.com/Engineer-of-Stuff/stable-diffusion-paperspace/main/StableDiffusionUI_Voldemort_paperspace.ipynb -O /notebooks/StableDiffusionUI_Voldemort_paperspace.ipynb
回車。
開始複製下載到notebook。
同時我們可以從左側標簽切換文件夾「File Browser」和正在運行的終端内核「Running Terminals and Kernels」窗口

點左側標簽的「File Browser」文件夾icon,雙擊下好的ipynb文件。彈出Automatic1111的SD webui。
第二次再開就可以直接點這個,不需要上面的代碼下載了。
可以把Terminal關掉了。

【初期設定,修改代碼】
中間窗口是Automatic1111和Voldemort的代碼。
但還不能直接用,我們需要對代碼進行一點小小的改動。(指尖宇宙)
懂英文和編程語言,可以直接看作者的介紹和注釋。

不懂我説明:
# Free Tier
# model_storage_dir = '/tmp/stable-diffusion-models'
# Paid Tier
# model_storage_dir = '/storage/models'
這段的意思是我們需要一個存儲空間,免費的存儲空間是臨時的,還小。
付費就是,永久,又大。

因爲是白嫖,
所以我們把Free下面的井號,也就是##刪除。
可以用退格鍵,也可以Ctrl+/ 。
Ctrl+/更適合大段修改。
改成這樣:
# Free Tier
model_storage_dir = '/tmp/stable-diffusion-models'

然後接下來
把xformer關掉
activate_xformers = True
改成
activate_xformers = False
(#解釋 可不看#
因爲我們是白嫖的GPU,性能不行,用xformer有提升,但還是會出問題。
所以下面的xformer下載地址,作者Voldemort給注釋掉了。
也就是説,你開了這個也沒用,下面的下載地址實際上是空的。
我用通用版xformer還是出錯,所以建議這個也乾脆關了。
#解釋 可不看#)


(可選)下面
activate_deepdanbooru = False
這個可以改成True(可選)
activate_deepdanbooru = True



【模型設定,添加代碼】
往下拉,直到~
「Download the Model」
我們把自帶模型的代碼區塊都刪了,如果二次元,可以留一手animefull-final-pruned。(這是最初的NovelAI)
因爲資源空間有限,這些老模型,不是很必要。
不管三次元,還是二次元,現在都有更新的了。
或者也可自己上傳模型,左側文件夾可以上傳。
仿照代碼,寫一下鏈接到Hugging Face的模型。
注:Hugging Face有可能失效,及時更換鏈接。

我們可以複製單元格Copy Cell。
以便在作者的基礎上修改。

或者,以我的二次元爲例:

try:
    %store -r model_storage_dir repo_storage_dir
    test = [model_storage_dir, repo_storage_dir]
except NameError as e:
    print("There is an issue with your variables.")
    print("Please go back to the first block and make sure your settings are correct, then run the cell.")
    print('Error:', e)
    import sys
    sys.exit(1)

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/NegiInNattoMaki/Nabylon-v1.0/resolve/main/Nabylon-v1.2-fp16.safetensors -d "{model_storage_dir}" -o "Nabylon-v1.2-fp16.safetensors"

# !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
# !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/BGLuck/AOM3Mixes/resolve/main/AOM3-pastelmix_30-r34-SF1.1.safetensors -d "{model_storage_dir}" -o "AOM3-pastelmix_30-r34-SF1.1.safetensors"

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/levovix/Grapefruit/resolve/main/grapefruitHentaiModel_grapefruitv41.safetensors -d "{model_storage_dir}" -o "grapefruitHentaiModel_v41.safetensors"

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/gsdf/Counterfeit-V2.5/resolve/main/Counterfeit-V2.5_pruned.safetensors -d "{model_storage_dir}" -o "Counterfeit-V2.5_pruned.safetensors"

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/ckpt/anything-v4.5-vae-swapped/resolve/main/anything-v4.5-vae-swapped.safetensors -d "{model_storage_dir}" -o "anything-v4.5-vae-swapped.safetensors"

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/iZELX1/SlimeX/resolve/main/SlimeX.safetensors -d "{model_storage_dir}" -o "SlimeX.safetensors"

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix2/AbyssOrangeMix2_hard.safetensors -d "{model_storage_dir}" -o "AbyssOrangeMix2_hard.safetensors"

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix3/AOM3A1.safetensors -d "{model_storage_dir}" -o "AOM3A1.safetensors"

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/HIZ/aichan_pick/resolve/main/Treebark-pruned-fp32.safetensors -d "{model_storage_dir}" -o "Treebark-pruned-fp32.safetensors"



再然後,也可以自己多加一些其他的,比如VAE和Lora。
我加的例子:
VAE
try:
    %store -r model_storage_dir repo_storage_dir
    test = [model_storage_dir, repo_storage_dir]
except NameError as e:
    print("There is an issue with your variables.")
    print("Please go back to the first block and make sure your settings are correct, then run the cell.")
    print('Error:', e)
    import sys
    sys.exit(1)

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/VAEs/orangemix.vae.pt -d "{model_storage_dir}/vae" -o "orangemix.vae.pt"

LoRA
try:
    %store -r model_storage_dir repo_storage_dir
    test = [model_storage_dir, repo_storage_dir]
except NameError as e:
    print("There is an issue with your variables.")
    print("Please go back to the first block and make sure your settings are correct, then run the cell.")
    print('Error:', e)
    import sys
    sys.exit(1)

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/nnmx/ohogao_lora/resolve/main/ohogao_lora/ohogao.safetensors -d "{model_storage_dir}/Lora" -o "ohogao.safetensors"
!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/nnmx/ohogao_lora/resolve/main/ohogao_lora/ohogaoV2.safetensors -d "{model_storage_dir}/Lora" -o "ohogaoV2.safetensors"

!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E9%A3%8E%E6%A0%BC/%E6%A6%82%E5%BF%B5-PLAY-%E7%B2%BE%E6%B5%B4%E3%80%90gokkun_cum%20%2B%20mug%20or%20bowl%20or%20bath%20tub%E3%80%91.safetensors -d "{model_storage_dir}/Lora" -o "bath.safetensors"
!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E8%A1%8C%E4%B8%BA/%E5%96%B7%E5%A5%B6pee%2B%E5%B0%BF%E5%B0%BFlactation.safetensors -d "{model_storage_dir}/Lora" -o "lactation.safetensors"
!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E8%A1%8C%E4%B8%BA/%E6%B7%AB%E9%AD%94%E5%8C%96%E6%A6%82%E5%BF%B5%EF%BC%880.6%E5%B7%A6%E5%8F%B3%EF%BC%89.safetensors -d "{model_storage_dir}/Lora" -o "succubus.safetensors"
!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E9%A3%8E%E6%A0%BC/%E6%A6%82%E5%BF%B5angelical%E5%A4%A9%E4%BD%BFLORA_v1.safetensors -d "{model_storage_dir}/Lora" -o "angelical.safetensors"
!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E9%A3%8E%E6%A0%BC/wow369%E7%94%BB%E9%A3%8E%2C%E8%A7%A6%E5%8F%91%E8%AF%8Dwow369%2C%E4%BD%BF%E7%94%A8pregnant%2Clactation%E6%9C%89%E9%A2%9D%E5%A4%96%E9%99%84%E9%AD%94%E5%8A%A0%E6%88%90.safetensors -d "{model_storage_dir}/Lora" -o "wow369.safetensors"
!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E9%A3%8E%E6%A0%BC/%E6%A6%82%E5%BF%B5-%E9%80%8F%E6%98%8E%E5%85%94%E5%A5%B3%E9%83%8E%E3%80%90outfit-tbunny%E3%80%91.safetensors -d "{model_storage_dir}/Lora" -o "outfit-tbunny.safetensors"
!if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
!aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E6%97%A5%E6%9C%9F/%E7%94%B5%E6%8A%A5/%E5%85%AC%E4%B8%BB%E8%BF%9E%E7%BB%93-%E5%8F%AF%E5%8F%AF%E8%90%9D-HL.safetensors -d "{model_storage_dir}/Lora" -o "kokkoro-HL.safetensors"


代碼修改的差不多了,空間快裝不下了,先這樣。

【啓動代碼】
我們點擊編輯器上方的全部啓動。
「Restart Kernel and Run All Cells...」
點擊紅色「Restart」
在執行到「Clean up and restart the kernel」時,kernel會重啓。
點擊Ok。
注意,此時我們不需要再重頭運行了。文件都已經下好了。再重頭運行就是再下載一遍浪費時間。
我們甚至可以F5刷新頁面。
在「Clean up and restart the kernel」下面的區塊,
我們找到「Link the models directory」連接到臨時空間,點擊小三角執行,或者Shift+Enter。


【啓動webui】
現在文件都已經下好也連接好了。
啓動「Launch the WebUI」下面的代碼單元格。
運行好了就和其他的webui一樣,點gradio鏈接。
終於可以開始玩了~~~

另外,注意切換模型。
代碼鏈接的時候會把lora也當成大模型。
我懶得改代碼了。
歇了歇了。

105826.jpg

Leader Three

截屏圖文版:(和文字版一樣,只是有圖片)

【建立Project/Notebook項目】
已經創建好賬號。
在最初的畫面右上,有按鈕「CREATE A PROJECT」,建立一個項目。


名字隨便,自動生成的也行。
在PROJECT界面,Notebooks頁,點擊中間紅色「CREATE」。如果已經有一個存在就是右上「CREATE」。建立一個Notebook記事冊。


出現新窗口。


「Select a runtime」運行時選擇「Start from Scratch」。
爲啥不要PyTorchTensorFlowStableDiffusion?
因爲我們要用別人的現成的代碼和庫,那些不全。

「Select a machine」機器選擇「Free-GPU」,免費GPU。
GPU有可能是灰的,那麽等一會,刷新。或者等人少的時候。還有像我上面説的網速。也可以試試梯子,換自己的IP。
所以點這個的優先級最高,其他選項可以往後稍稍。

「Auto-shutdown timeout」自動停止時間改爲6小時

「Advanced options」高級選項就不需要了。
不要浪費網速和時間。
趕緊點紅色「START NOTEBOOK」按鈕。



【啓動終端,複製代碼】
現在,進入了我們所創建的notebook界面。
  

點左側標簽的Jupyter朱庇特icon,也就是那個橙黃色的圈圈或框框。「Open in JupyterLab」。

進入更底層的Jupyter編輯界面。
在中間窗口的「Others」下面,點「Terminal」終端。



輸入代碼:
复制代码
  1. wget https://raw.githubusercontent.com/Engineer-of-Stuff/stable-diffusion-paperspace/main/StableDiffusionUI_Voldemort_paperspace.ipynb -O /notebooks/StableDiffusionUI_Voldemort_paperspace.ipynb

回車。


開始複製下載到notebook。
同時我們可以從左側標簽切換文件夾「File Browser」和正在運行的終端内核「Running Terminals and Kernels」窗口


點左側標簽的「File Browser」文件夾icon,雙擊下好的ipynb文件。彈出Automatic1111的SD webui。
第二次再開就可以直接點這個,不需要上面的代碼下載了。
可以把Terminal關掉了。

【初期設定,修改代碼】
中間窗口是Automatic1111和Voldemort的代碼。
但還不能直接用,我們需要對代碼進行一點小小的改動。(指尖宇宙)
懂英文和編程語言,可以直接看作者的介紹和注釋。


不懂我説明:
# Free Tier
# model_storage_dir = '/tmp/stable-diffusion-models'
# Paid Tier
# model_storage_dir = '/storage/models'
這段的意思是我們需要一個存儲空間,免費的存儲空間是臨時的,還小。
付費就是,永久,又大。
因爲是白嫖,
所以我們把Free下面的井號,也就是##刪除。
可以用退格鍵,也可以Ctrl+/ 。
Ctrl+/更適合大段修改。
改成這樣:
# Free Tier
model_storage_dir = '/tmp/stable-diffusion-models'

然後接下來
把xformer關掉
activate_xformers = True
改成
activate_xformers = False
(#解釋 可不看#
因爲我們是白嫖的GPU,性能不行,用xformer有提升,但還是會出問題。
所以下面的xformer下載地址,作者Voldemort給注釋掉了。
也就是説,你開了這個也沒用,下面的下載地址實際上是空的。
我用通用版xformer還是出錯,所以建議這個也乾脆關了。
#解釋 可不看#)
(可選)下面
activate_deepdanbooru = False
這個可以改成True(可選)
activate_deepdanbooru = True



【模型設定,添加代碼】
往下拉,直到~
「Download the Model」


我們把自帶模型的代碼區塊都刪了,如果二次元,可以留一手animefull-final-pruned。(這是最初的NovelAI)
因爲資源空間有限,這些老模型,不是很必要。
不管三次元,還是二次元,現在都有更新的了。
或者也可自己上傳模型,左側文件夾可以上傳。
仿照代碼,寫一下鏈接到Hugging Face的模型。
注:Hugging Face有可能失效,及時更換鏈接。

我們可以複製單元格Copy Cell。
以便在作者的基礎上修改。


或者,以我的二次元爲例:
复制代码
  1. try:
  2.     %store -r model_storage_dir repo_storage_dir
  3.     test = [model_storage_dir, repo_storage_dir]
  4. except NameError as e:
  5.     print("There is an issue with your variables.")
  6.     print("Please go back to the first block and make sure your settings are correct, then run the cell.")
  7.     print('Error:', e)
  8.     import sys
  9.     sys.exit(1)
  10. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  11. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/NegiInNattoMaki/Nabylon-v1.0/resolve/main/Nabylon-v1.2-fp16.safetensors -d "{model_storage_dir}" -o "Nabylon-v1.2-fp16.safetensors"
  12. # !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  13. # !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/BGLuck/AOM3Mixes/resolve/main/AOM3-pastelmix_30-r34-SF1.1.safetensors -d "{model_storage_dir}" -o "AOM3-pastelmix_30-r34-SF1.1.safetensors"
  14. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  15. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/levovix/Grapefruit/resolve/main/grapefruitHentaiModel_grapefruitv41.safetensors -d "{model_storage_dir}" -o "grapefruitHentaiModel_v41.safetensors"
  16. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  17. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/gsdf/Counterfeit-V2.5/resolve/main/Counterfeit-V2.5_pruned.safetensors -d "{model_storage_dir}" -o "Counterfeit-V2.5_pruned.safetensors"
  18. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  19. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/ckpt/anything-v4.5-vae-swapped/resolve/main/anything-v4.5-vae-swapped.safetensors -d "{model_storage_dir}" -o "anything-v4.5-vae-swapped.safetensors"
  20. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  21. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/iZELX1/SlimeX/resolve/main/SlimeX.safetensors -d "{model_storage_dir}" -o "SlimeX.safetensors"
  22. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  23. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix2/AbyssOrangeMix2_hard.safetensors -d "{model_storage_dir}" -o "AbyssOrangeMix2_hard.safetensors"
  24. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  25. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/Models/AbyssOrangeMix3/AOM3A1.safetensors -d "{model_storage_dir}" -o "AOM3A1.safetensors"
  26. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  27. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/HIZ/aichan_pick/resolve/main/Treebark-pruned-fp32.safetensors -d "{model_storage_dir}" -o "Treebark-pruned-fp32.safetensors"


再然後,也可以自己多加一些其他的,比如VAE和Lora。
我加的例子:
VAE
复制代码
  1. try:
  2.     %store -r model_storage_dir repo_storage_dir
  3.     test = [model_storage_dir, repo_storage_dir]
  4. except NameError as e:
  5.     print("There is an issue with your variables.")
  6.     print("Please go back to the first block and make sure your settings are correct, then run the cell.")
  7.     print('Error:', e)
  8.     import sys
  9.     sys.exit(1)
  10. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  11. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue [url]https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/VAEs/orangemix.vae.pt[/url] -d "{model_storage_dir}/vae" -o "orangemix.vae.pt"

LoRA
复制代码
  1. try:
  2.     %store -r model_storage_dir repo_storage_dir
  3.     test = [model_storage_dir, repo_storage_dir]
  4. except NameError as e:
  5.     print("There is an issue with your variables.")
  6.     print("Please go back to the first block and make sure your settings are correct, then run the cell.")
  7.     print('Error:', e)
  8.     import sys
  9.     sys.exit(1)
  10. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  11. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/nnmx/ohogao_lora/resolve/main/ohogao_lora/ohogao.safetensors -d "{model_storage_dir}/Lora" -o "ohogao.safetensors"
  12. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  13. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/nnmx/ohogao_lora/resolve/main/ohogao_lora/ohogaoV2.safetensors -d "{model_storage_dir}/Lora" -o "ohogaoV2.safetensors"
  14. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  15. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E9%A3%8E%E6%A0%BC/%E6%A6%82%E5%BF%B5-PLAY-%E7%B2%BE%E6%B5%B4%E3%80%90gokkun_cum%20%2B%20mug%20or%20bowl%20or%20bath%20tub%E3%80%91.safetensors -d "{model_storage_dir}/Lora" -o "bath.safetensors"
  16. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  17. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E8%A1%8C%E4%B8%BA/%E5%96%B7%E5%A5%B6pee%2B%E5%B0%BF%E5%B0%BFlactation.safetensors -d "{model_storage_dir}/Lora" -o "lactation.safetensors"
  18. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  19. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E8%A1%8C%E4%B8%BA/%E6%B7%AB%E9%AD%94%E5%8C%96%E6%A6%82%E5%BF%B5%EF%BC%880.6%E5%B7%A6%E5%8F%B3%EF%BC%89.safetensors -d "{model_storage_dir}/Lora" -o "succubus.safetensors"
  20. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  21. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E9%A3%8E%E6%A0%BC/%E6%A6%82%E5%BF%B5angelical%E5%A4%A9%E4%BD%BFLORA_v1.safetensors -d "{model_storage_dir}/Lora" -o "angelical.safetensors"
  22. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  23. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E9%A3%8E%E6%A0%BC/wow369%E7%94%BB%E9%A3%8E%2C%E8%A7%A6%E5%8F%91%E8%AF%8Dwow369%2C%E4%BD%BF%E7%94%A8pregnant%2Clactation%E6%9C%89%E9%A2%9D%E5%A4%96%E9%99%84%E9%AD%94%E5%8A%A0%E6%88%90.safetensors -d "{model_storage_dir}/Lora" -o "wow369.safetensors"
  24. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  25. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E9%A3%8E%E6%A0%BC/%E6%A6%82%E5%BF%B5-%E9%80%8F%E6%98%8E%E5%85%94%E5%A5%B3%E9%83%8E%E3%80%90outfit-tbunny%E3%80%91.safetensors -d "{model_storage_dir}/Lora" -o "outfit-tbunny.safetensors"
  26. !if [ $(dpkg-query -W -f='${Status}' aria2 2>/dev/null | grep -c "ok installed") = 0 ]; then sudo apt update && sudo apt install -y aria2; fi
  27. !aria2c --file-allocation=none -c -x 16 -s 16 --summary-interval=0 --console-log-level=warn --continue https://huggingface.co/lintonxue00/lora/resolve/main/%E6%97%A5%E6%9C%9F/%E7%94%B5%E6%8A%A5/%E5%85%AC%E4%B8%BB%E8%BF%9E%E7%BB%93-%E5%8F%AF%E5%8F%AF%E8%90%9D-HL.safetensors -d "{model_storage_dir}/Lora" -o "kokkoro-HL.safetensors"

代碼修改的差不多了,空間快裝不下了,先這樣。



【啓動代碼】
我們點擊編輯器上方的全部啓動。


「Restart Kernel and Run All Cells...」


點擊紅色「Restart」
在執行到「Clean up and restart the kernel」時,kernel會重啓。


點擊Ok。
注意,此時我們不需要再重頭運行了。文件都已經下好了。再重頭運行就是再下載一遍浪費時間。
我們甚至可以F5刷新頁面。
在「Clean up and restart the kernel」下面的區塊,


我們找到「Link the models directory」連接到臨時空間,點擊小三角執行,或者Shift+Enter。


【啓動webui】
現在文件都已經下好也連接好了。


啓動「Launch the WebUI」下面的代碼單元格。


運行好了就和其他的webui一樣,點gradio鏈接。
終於可以開始玩了~~~

另外,注意切換模型。


代碼鏈接的時候會把lora也當成大模型。
我懶得改代碼了。
歇了歇了。

none.gif

759adfff

B3F  2023-03-09 12:51
(zzzzzzzz)
虎兄虎弟那你

none.gif

f1f0901d

谢谢楼主分享

wy76js.jpg

安娜锦之宫

B5F  2023-03-15 13:35
(安娜锦之宫)
前来支持

4.gif

叶雨时

怎么直接就到三了,二被删了吗

105826.jpg

Leader Three

引用
引用第6楼b46df9da于2023-03-21 15:01发表的  :
怎么直接就到三了,二被删了吗


https://blue-plus.net/read.php?tid-1754800.html
因爲二是Kaggle,我已經被Kaggle封了。所以我無法演示。
我給Kaggle發郵件請求也杳無音訊。
Kaggle何時赦免我,何時就有二。

none.gif

fa870ba8

虽然看不懂,但我大受震撼