#author("2023-08-28T16:36:12+09:00","default:okada","okada")
*Stable DiffusionTips2 [#o7f63b3a]

RIGHT:更新日&lastmod();
RIGHT:作成日:2023年8月16日

**日本語化 [#k45495e8]

&ref("./日本語化.png");

&ref("./日本語化2.png");

&ref("./日本語化3.png");

&ref("./日本語化4.png");

**Beautiful Realistic Asiansモデルの追加 [#f03ce4ef]

BRA5,BRA6を以下からDownload

***BRA5 [#t76fee59]

-https://civitai.com/models/25494?modelVersionId=63786

**BRA6 [#jddcb2a1]

-https://civitai.com/models/25494?modelVersionId=113479


ZIPを解凍して「models\Stable-diffusion\」に入れて再読み込み。

**ControlnetのInstall [#l0b04c84]

&ref("./Controlnet1.png");

-https://github.com/Mikubill/sd-webui-controlnet.git

&ref("./Controlnet2.png");

&ref("./Controlnet3.png");

&ref("./Controlnet4.png");

***参考 [#l271d763]
https://koneko3.com/how-to-use-controlnet/


**DynamicPromptのインストール [#c4f57a21]

「Dynamic Prompt」はプロンプトの中に{|}を使うことで、1つの呪文(プロンプト)を何パターンかに分けて、それぞれを画像生成する

&ref("./DynamicPromptInst1.png");

&ref("./DynamicPromptInst2.png");

&ref("./DynamicPromptInst3.png");

&ref("./DynamicPromptInst4.png");


**「Stable Diffusion web UI」のアップデート方法 [#pb30c4e4]

***参考 [#ja2c20c5]

-https://gigazine.net/news/20220907-automatic1111-stable-diffusion-webui/#3-5

**Controlnet モデル インストール [#o6a99d35]

Controlnetをインストールしただけだとモデルが入っていないので、Downloadしてインストールする~
14種類をDownloadする

***ダウウンロード [#c75b607f]

以下のURLにアクセス

-https://huggingface.co/

「controlnet」を検索する

&ref("./model_inst1.png");

以下のURLにジャンプする

https://huggingface.co/lllyasviel/ControlNet-v1-1

-「File and versions」のタブを選択する

&ref("./model_inst2.png");

-「LPS」の個所を全てDownloadする

&ref("./model_inst3.png");

***DLしたファイルをコピーする [#d8c845ea]

-モデルコピー先:

--C:\Usr\stable-diffusion-webui-master\extensions\sd-webui-controlnet\models

-モデルを再ロードすると選択できるようになる

&ref("./model_inst4.png");

***動作確認 [#jea66efb]

txt2imgでControlnetに適当な画像(プロンプトの内容に合うような画像)をドラッグ&ドロップして以下のようにしてみた

-プロンプト

a businesswoman in the midst of a sales pitch, earnestly engaging and persuading her audience.

-「ContorlNet」

--Preprocessor:openpose

--Model:openpose

***作成サンプル [#e6bbad98]

&ref("./cn_sample.png");

**メモリ不足対応 [#f7dec862]

以下のエラー対応

 RuntimeError: Not enough memory, use lower resolution (max approx. 512x512).

-webui-user.batを修正

 ' Edit by JE2ISM
 'set COMMANDLINE_ARGS=
 set COMMANDLINE_ARGS=--medvram


***参考 [#d52887b1]

-https://taziku.co.jp/blog/stable-diffusion-vram

**Error [#u5257b19]

-以下のエラー発生

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.

-対応

webui-user.batに以下を追加

set COMMANDLINE_ARGS=--no-half


--webui-user.bat

 ' Edit by JE2ISM
 'set COMMANDLINE_ARGS=
 set COMMANDLINE_ARGS=--medvram --no-half

今回は不要のようだが以下の変更も有効のようだ

&ref("./Error1.png");

-参考

--https://promptbank.jp/d/nansexception-a-tensor-with-all-nans-was-produced-in-unet-%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%8C%E5%87%BA%E3%82%8B/

**メモリ不足対応2 [#p183622e]

-以下のエラー発生

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 36.00 MiB (GPU 0; 4.00 GiB total capacity; 17.73 GiB already allocated; 0 bytes free; 17.84 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

-webui.bat に追加

 @echo off
 
 'Edit by JE2ISM
 set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.6, max_split_size_mb:128 ←ここ
 
 if not defined PYTHON (set PYTHON=python)
 if not defined VENV_DIR (set "VENV_DIR=%~dp0%venv")

-参考

--https://www.kageori.com/2022/11/stable-diffusion-web-uiruntimeerror.html

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS