
画像生成AIはGPUのメモリを多く必要とするためあまり大きなサイズの絵は描けないです(512×512くらいがよく使われます)が、画像の続きを描くことで大きな画像が生成できるOutpainting機能なんてのもあります。そのOutpainting機能や画像を一部を書き換えるInpainting機能などを直感的に使うことができる「Hua」が公開されたので使ってみました。
まずは、インストールしたStable Diffusion web AI(AUTOMATIC1111)をアップデート(git pull)して、webui-user.batを書き換え。
set COMMANDLINE_ARGS=--api --port xxxxx --cors-allow-origins=https://www.painthua.com
ポートのxxxxxは、10000から60000の間のすきな数字(使っていないポート番号)を指定します。
AIのモデルはInpaintingを強化したsd-v1-5-inpainting.ckptなんてのがあり、ここからダウンロードできますので、Stable Diffusion web AIのmodels/Stable-diffusionフォルダに配置して、指定しました。
あと、Stable Diffusion web AIのSettingsでInpainting conditioning mask strengthを1にする必要があります(変更している場合)。

webui-user.batを実行したあとに、Hua(https://www.painthua.com)を開きます。
Configアイコンを押して、”server”のポート番号を指定したものに変更します。

Promptボタンを押して、Promptを指定します。

好きな位置に四角の枠を配置して左クリック。作成する枚数を指定して左クリックすると画像が生成されます。
PrevやNextで良いのを選んで、Acceptを押せば確定、Cancelでキャンセル。1 Moreを押せばもう一枚作成されます。

生成した画像と重なりがある位置でもう一度生成を行うと、すでにある画像とつながりがある画像が生成されます。
このとき、プロンプトを書き換えて生成することも可能です。


これを続けていくとどんどん画像を拡大していけます。不要な部分を右クリックで削除したりもできます。

画像の一部修正(Inpainting)も可能。Maskアイコンを押すと、画像を一部を塗ることができるので、書き換えたいところを塗ります。

Maskアイコンをもう一度押して、画像生成すると、書き換えることができます。

Ctrl+Sを押すと生成した画像がダウンロードされます。
今回使っていないですが、i2i modeを押すと、img2imgでStrengthしていした強度で一部を書き換えることもできます。

ものすごく適当ですが、こんな絵ができました。

別のプロンプトで単純にOutpaintingで拡張してみた絵。

InpaintingやPrompt書き換え、不要部分の削除などしたらこんな絵になりました。よく見ると色々変ですが、それっぽくて面白いですね。


全体の整合性などは考慮されませんが、単純にStable Diffusionで大きな絵を描きたいときには使えると思います。

ちなみにNovelAIのモデルで試したところ、なかなかぴったり合う感じにならないので、img2imgとかInpaintで調整が必要ですね。