1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Stable Diffusion でフォトリアルな水着美女を生成する方法

Last updated at Posted at 2023-04-13

Stable Diffusion Web UI を Google Colab 上で無料で使うことができなくなり、有料プランも定額でない(コンピューティングユニットがなくなったら追加課金がいる)ので、以下の新記事『【Paperspace】Stable Diffusion Web UI を月額定額で使う』も読んでみてください。

以下の記事の紹介コード付きURLからサインアップすると Paperspace の Pro プラン(月額定額8ドル)を一か月無料で試すことができます。


例えば、こんな感じ。実在の美女じゃないですよ!

やり方

以下の記事に従って Paperspace Pro 以上のアカウントを持っている方は「## B. Paperspace のアカウントを持っている場合」に進んでください。

A. Paperspace のアカウントを持ってない場合

A.1 Google Colab に行きます。

https://colab.research.google.com/?hl=ja

image.png

A.2 GPUの設定を行います

image.png

A.3 コードを実行します。

image.png

【2023/04/25】「貼り付けるコード」を修正しました。(上記写真と違ってますが気にしないで)

貼り付けるコード
!pip install -q torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 torchtext==0.15.1 torchdata==0.6.0 --extra-index-url https://download.pytorch.org/whl/cu118 -U
!pip install -q xformers==0.0.18 triton==2.0.0 -U

!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui

!wget https://civitai.com/api/download/models/11745 -O /content/stable-diffusion-webui/models/Stable-diffusion/Chilloutmix-Ni-pruned-fp32-fix.safetensors

!python launch.py --share --xformers --enable-insecure-extension-access

A.4 コードの実行が完了したサイン

image.png

B. Paperspace のアカウントを持っている場合

Paperspace Pro 以上のアカウントを持っている方は以下の記事を復習して Web UI を起動してください。

B.1 マシン(notebook-01)を起動します。

B.2「(3) WebUI起動」の「Run」をクリックしてコンソールに「Running on public URL:」とでるのを待ちます。

「Running on public URL:」と出たら、URLをクリックします。

B.3「Chilloutmix-Ni-pruned-fp32-fix.safetensors」を選択します

image.png

ここから、Google Colab およびPaperspace 共通手順

カスタムの Stable Diffusion のUI画面

image.png

文頭の画像を生成したオプション

  • Prompt に以下を入力しました。
(masterpiece, best quality:1), (photorealistic:1.2), light, depth of field, (detailed face, face focus:1), game cg, ultra detailed, 8k, intricate details, hiqcg,
1 girl, solo,
one-piece_swimsuit,
full body,
  • Negative Prompt に以下を入力しました。
(worst quality:1.2), (low quality:1.2), (lowres:1.1), (monochrome:1.1), (greyscale), multiple views, comic, sketch, 
EasyNegative
  • Width を 512、Height を 768 に設定し、CFG Scale を 7 に設定しました。

これで「Generate」ボタンを押すだけ。ただ、足の上に直頭がついたり、腕が三本あったりなど変な画像も出てきますが、そこは気長に・・・

最後に

冒頭に張り付けた画像は実際に私が(厳密にはAIが)生成しました。
この手順に従えばだれでもできます。

ぜひやってみてください!それでは!

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?