Stable Diffusion

Python

リンク

Automatic1111をGoogle Colabで動かすhttps://yuuyuublog.org/facebombmix/#toc3
Automatic1111でLoRAを追加https://self-development.info/automatic1111%E7%89%88web-ui%E3%81%A7lora%E3%82%92%E5%88%A9%E7%94%A8%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/
Automatic1111でTextInversionを追加https://blogcake.net/easynegative/
camenduruでAutomatic1111を最速で開くhttps://yuuyuublog.org/camenduru/
VAEの導入https://blogcake.net/stable-diffusion-vae/
control netの導入https://www.youtube.com/watch?v=VFNoy0BDNhc
Multi Controlで背景と人物を合成https://e-penguiner.com/stable-diffusion-multi-controlnet/
checkpointMergerでモデルをマージhttps://e-penguiner.com/stable-diffusion-checkpoint-merger/
複数のLoRAをGoogle Colabに入れる方法https://yuuyuublog.org/ai_cosplay/
一つのLoRAをGoogle Colabに入れる方法https://yuuyuublog.org/koreandolllikeness/
hires.fixによる高画質化https://yuuyuublog.org/hiresfix/
LoRAの自作https://yuuyuublog.org/sdwebuitraintools/
任意の画像からプロンプトを取得https://yuuyuublog.org/dataset_tag_editor/
デフォルト外のUpScaler(4x_UltraSharp)を使用https://yuuyuublog.org/4x-ultrasharp/
同じキャラクターに別のポーズをとらせるhttp://tanoshare.com/hobby/6238
x/y/z plotを使って複数の画像を一度に作成https://yuuyuublog.org/xyzplot/
HypernetWorkで画風を指定https://yuuyuublog.org/hypernetworks/
複数の画像を一度に生成 prompt from texthttps://www.youtube.com/watch?v=j9ofjP41XT8
Latent Couple Extentsionで複数の人物を描写https://yuuyuublog.org/latent_couple_extension/
OpenposeEditorでポーズを指定https://kurokumasoft.com/2023/02/21/openpose-editor/
Depth map library and poserで手を正確に描写https://kurokumasoft.com/2023/03/04/sd-webui-depth-lib/
Depth map library and poserにHires.fixを組み合わせるhttps://www.youtube.com/watch?v=453_sPg6My8
構図そのまま画像拡大(poor man’s outpainting)https://yuuyuublog.org/poormansoutpainting/
dynamic promptでランダムなプロンプトを生成https://sukolity.fanbox.cc/posts/5191693?utm_campaign=manage_post_page&utm_medium=share&utm_source=twitter

モデル(二次元)

モデル名link得意分野おすすめ度
Perfect Worldhttps://civitai.com/models/8281/perfect-world完美世界2.5次元★★★
yorrrlmixhttps://civitai.com/models/17938/yorrrlmix2.5次元
facebombmix2.5次元(独特)★★★★
AnythingV4二次元★★★★★
AnythingV3https://fls.hatenablog.com/entry/2022/11/14/202941 (colab)二次元
CarDos Animehttps://civitai.com/models/25399/cardos-animeちびキャラ
AnyLora
AnyHentainsfw
7th_layer
waifu diffusion二次元
ShiratakiMixhttps://huggingface.co/Vsukiyaki/ShiratakiMix/tree/maincolorfulな二次絵★★★★
doll7743d doll
MeinaMixhttps://www.youtube.com/watch?v=Xwvel7bJpE0原神系 二次元
MeinaUnrealhttps://civitai.com/models/18798/meinaunreal?modelVersionId=22314
OsukiniMixhttps://huggingface.co/Vsukiyaki/OsukiniMix/tree/mainVすき焼き氏の二次元モデル
饭特稀_v0.8https://civitai.com/models/18427?modelVersionId=24196
ExpMix_Linehttps://civitai.com/models/44150/expmixlinememe50にそっくりな二次元モデル★★★★★
KencanMixhttps://civitai.com/models/34686/kencanmix?modelVersionId=47979
AbyssOrangeMix(V3)Version2と3がある★★★★
AbyssOrangeMix(V2)https://civitai.com/images/367673?period=Day&sort=Most+Reactions&tags=5133★★★★
Cetus Mixhttps://civitai.com/models/6755/cetus-mix?modelVersionId=8298AnythingやAbyssより一歩劣る★★
Ghost Mixhttps://civitai.com/images/478282?period=Day&sort=Most+Reactions&tags=5133背景描写が細かい
KoreanStyle2.5Dhttps://civitai.com/models/12975/koreanstyle25d?modelVersionId=17085

モデル(三次元)

henmix real(アジア人)

realDosMix(https://www.youtube.com/watch?v=YsTSrjfmlag (colab)

chilloutmix(https://github.com/nolanaatama/sd-1click-colab

NewMarsMix(西洋人)

cityedgemix(https://civitai.com/models/38464/cityedgemix

Lucky Strike Mix

OrangeChillMix(https://civitai.com/models/9486/orangechillmix

Deliberate v2(https://civitai.com/models/4823/deliberate?modelVersionId=15236

NeverEndingDream(https://civitai.com/models/10028/neverending-dream-ned?modelVersionId=11925

kanpiroMIx

fantasticmix_real(https://civitai.com/models/22402/fantasticmixreal?modelVersionId=30145

SunshineMix&SunlightMix(https://civitai.com/models/9291/sunshinemixsunlightmix?modelVersionId=11194

Basil Mix

GenesisLifeMix(https://www.youtube.com/watch?v=e_Jct_V2xts  (colab)

KencanMix(https://civitai.com/models/34686/kencanmix?modelVersionId=47979

各種コード

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Online-Services
!pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 torchtext==0.14.1 torchdata==0.5.1 –extra-index-url https://download.pytorch.org/whl/cu116
from google.colab import drive
drive.mount(‘/content/drive’)
!cp /content/drive/MyDrive/StableDiffusion/Model/facebombmix_v1.safetensors /content/stable-diffusion-webui/models/Stable-diffusion/
!cp /content/drive/MyDrive/StableDiffusion/VAE/kl-f8-anime2.ckpt /content/stable-diffusion-webui/models/VAE
–xformers
もしくはノートブックを新規作成から次のコードを実行(CivitaiからDLする場合は、https://civitai.com/api/download/models/24196のようにする)
%pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchtext==0.14.1 torchaudio==0.13.1 torchdata==0.5.1 –extra-index-url https://download.pytorch.org/whl/cu117
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
!wget https://huggingface.co/nuigurumi/basil_mix/resolve/main/Basil_mix_fixed.safetensors -O /content/stable-diffusion-webui/models/Stable-diffusion/Basil_mix_fixed.safetensors
!wget https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors -O /content/stable-diffusion-webui/models/VAE/vae-ft-mse-840000-ema-pruned.safetensors
!python launch.py –share –xformers –enable-insecure-extension-access
最速でWebUIを起動
https://github.com/camenduru/stable-diffusion-webui-colab
https://www.youtube.com/@nolanaatama/videos

エラー

ChilloutMixを実行してpublic urlが表示されず、次のエラーが出た
RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.7 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install.
https://yuuyuublog.org/facebombmix/#toc3
https://qiita.com/maskot1977/items/1d11d5875054b5a345ad
を参考にすること
StableDiffusionWebUI上で実行したときに次のエラーが発生
NansException: A tensor with all NaNs was produced in Unet.
https://blogcake.net/sd-cant-generate/
を参考に設定を変えること
これでダメな場合は、
https://wikiwiki.jp/sd_toshiaki/%E3%82%A8%E3%83%A9%E3%83%BC%E8%A7%A3%E6%B1%BA%E3%83%A1%E3%83%A2#we158a86
を参考にすること。WebUIのモデルにLoRAを設定しているかららしい。
拡張子が「.safetensors」でもLoRAとモデル本体のものがある
WebUIを起動後に、colabにError: Exception in ASGI application
local URLでやると直る もしくは画像が生成されるまでもう少し待つこと
警告: GPU ランタイムに接続していますが、GPU は使用されていません
Googleから一時的にペナルティを受けている状態
NansException: A tensor with all NaNs was produced in VAE. This could be because there’s not enough precision to represent the picture. Try adding –no-half-vae commandline argument to fix this. Use –disable-nan-check commandline argument to disable this check.
https://huggingface.co/andite/anything-v4.0/discussions/23
メモ帳でwebui-user.batを開き、set COMMANDLINE_ARGSに 「–no-half-vae」を追加して上書き保存
ControlNetをAutomatic1111に追加する際に、AssertionErrorが出る場合
https://murasan-net.com/index.php/2023/03/02/paperspace-automatic1111-howto/
COMMAND_LINE の–gradio–auth me: qwertyのあとに –enable-insecure-extension-accessを追加するだけ
OutOfMemoryError: CUDA out of memory
GPUのメモリ不足

BACK