ImaginAIry は,Python から stable diffusion 画像の生成を扱う機能を持ったソフトウエア.
【目次】
【サイト内の関連ページ】
Ubuntu について: 別ページ »で説明
【関連する外部ページ】
ImaginAIry の GitHub のページ: https://github.com/brycedrennan/imaginAIry
Windows での Git のインストール: 別ページ »で説明
【関連する外部ページ】
Git の公式ページ: https://git-scm.com/
Windows での Python 3.10,関連パッケージ,Python 開発環境のインストール: 別ページ »で説明
【サイト内の関連ページ】
Python のまとめ: 別ページ »にまとめ
【関連する外部ページ】
Python の公式ページ: https://www.python.org/
Windows での Build Tools for Visual Studio 2022,NVIDIA ドライバ,NVIDIA CUDA ツールキット 11.8,NVIDIA cuDNN v8.6 のインストールと動作確認: 別ページ »で説明
【関連する外部ページ】
コマンドプロンプトを管理者として実行: 別ページ »で説明
PyTorch のページ: https://pytorch.org/index.html
次のコマンドは, PyTorch 2.0 (NVIDIA CUDA 11.8 用) をインストールする. 事前に NVIDIA CUDA のバージョンを確認しておくこと(ここでは,NVIDIA CUDA ツールキット 11.8 が前もってインストール済みであるとする).
python -m pip install -U pip python -m pip install -U torch torchvision torchaudio numpy numba --index-url https://download.pytorch.org/whl/cu118 python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
コマンドプロンプトを管理者として実行: 別ページ »で説明
python -m pip install -U imaginairy
cd %HOMEPATH% rmdir /s /q imaginAIry git clone --recursive https://github.com/brycedrennan/imaginAIry
https://github.com/brycedrennan/imaginAIry の手順に従う.
次を実行することにより,画像ファイルが生成される.画像ファイル名が表示されるので確認.
imagine "海沿いを走る"
imagine "a scenic landscape"
次を実行することにより,画像ファイルが生成される.画像ファイル名が表示されるので確認.
imagine --model SD-2.1 "海沿いを走る"
imagine --model SD-2.1 "a scenic landscape"
InstructPix2Pix を使用している
InstructPix2Pix の GitHub のページ: https://github.com/timothybrooks/instruct-pix2pix
cd %HOMEPATH% cd imaginAIry cd assets aimg edit scenic_landscape_winter.jpg "make a sky sunset"
元画像
画像編集の結果
cd %HOMEPATH% cd imaginAIry cd assets aimg edit 000032_337692011_PLMS40_PS7.5_a_photo_of_a_dog.jpg "make a dog white"
元画像
画像編集の結果
cd %HOMEPATH% cd imaginAIry cd assets aimg edit 000056_293284644_PLMS40_PS7.5_photo_of_a_bowl_of_fruit.jpg "make fruits vegetables"
元画像
画像編集の結果
cd %HOMEPATH% cd imaginAIry cd assets aimg edit spock.jpg "make a man long hair" --prompt-strength 20
元画像
画像編集の結果
cd %HOMEPATH% cd imaginAIry cd assets aimg edit spock.jpg "add glasses"
元画像
画像編集の結果
cd %HOMEPATH% cd imaginAIry cd assets aimg edit spock.jpg "make color tropical"
元画像
画像編集の結果
clipseg を使用している.
clipseg の GitHub のページ: https://github.com/timojl/clipseg
cd %HOMEPATH% cd imaginAIry cd assets imagine ^ --init-image girl_with_a_pearl_earring.jpg ^ --mask-prompt "face AND NOT (bandana OR hair OR blue fabric){*6}" ^ --mask-mode keep ^ --init-image-strength .2 ^ --fix-faces ^ "a young girl" "an old lady" "white dressed" "fireman"
元画像
Prompt Based Masking の結果
cd %HOMEPATH% cd imaginAIry cd assets imagine ^ --init-image 000056_293284644_PLMS40_PS7.5_photo_of_a_bowl_of_fruit.jpg ^ --mask-prompt "fruit OR fruit stem{*6}" ^ --mask-mode replace ^ --mask-modify-original ^ --init-image-strength .1 ^ "ball" "animal doll" "soup" "rice" "candy" "pencil"
元画像
Prompt Based Masking の結果
Stable Diffusion 2 Depth を使用している.
cd %HOMEPATH% cd imaginAIry cd assets imagine --model SD-2.0-depth --init-image mona-lisa.jpg --init-image-strength 0.05 "professional headshot photo of a woman" -r 4 -w 1024 -h 1024 --steps 50