Stable Diffusionで、ControlNetのOpenposeを利用して画像を生成する上で必要な棒人間データですが
「Openpose Editor」というツールでできるということで早速利用してみたいと思います。
目次
Colaboratoryを起動し、stable-diffusion-webuiを取得する
!git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
%cd /content/stable-diffusion-webui
Stable Diffusionを起動する
!python launch.py --share --xformers --enable-insecure-extension-access

起動時に、以下のエラーが出ました。
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.
以下を実行しランタイムを再起動します。
pip install torchvision==0.12.0
ディレクトリが変わっているので、以下で元の場所に移動します。
cd stable-diffusion-webui/
起動します。
!python launch.py --share --xformers --enable-insecure-extension-access
Extensionsタブから、Openpose Editorをインストールする
ExtensionsタブのInstall from URLに、「https://github.com/fkunn1326/openpose-editor.git」を入力し、Installボタンを押下します。

インストールが完了すると以下のメッセージがでます。

Installedに切り替えて、適用して再起動します。

再起動で、OpenPose Editorのタブが出来上がっていれば完了です。

実際に使ってみる
支点の部分をドラグ&ドロップすれば簡単に変更できます。
今回は、ControlNetを入れずに実行したため、Send to txt2imgではtxt2imgタブが表示されただけですが
Controlnetの所に、画像が反映されるようです。
一旦、画像としてローカルに保存しておけば、再利用可能なためその方がよいかもしれません。
