【初心者向け】DallE2のインペインティング(Inpainting)の方法!
![](https://blogcake.net/wp-content/uploads/2023/03/dalle2-inpating.jpg)
こんにちは、AIでひらすら猫のイラストを生成している じょじお(@jojio‗illust)です。
この記事ではDallE2の解説の続きです。インペインティング(Inpainting)のやり方を初心者向けに解説しています。
![](https://blogcake.net/wp-content/uploads/2022/11/dalle2-downsized-300x158.jpg)
▲Dalleを初めて使う方はまずはこちらの初心者向け解説を見た方がわかりやすいです。
![](https://blogcake.net/wp-content/uploads/2023/02/eagle-eyecatch-300x158.jpg)
▲AI画像の大量ファイルをプロンプトと一緒に簡単に整理する方法はこちら。
![](https://blogcake.net/wp-content/uploads/2023/01/capture_01-300x158.jpg)
▲素材に関連する英単語100個以上まとめました。
![](https://blogcake.net/wp-content/uploads/2022/11/Midjourney-prompt-matome-300x158.jpg)
▲すべてのプロンプト関連記事はこちらにまとめています。
![](https://blogcake.net/wp-content/uploads/2023/01/midjourney2-300x158.jpg)
▲Midjourneyユーザー向け。専用Discordサーバーを作って画像生成作業を効率化する方法。
DallE2のインペインティング(Inpainting)とは?
![DallE2のインペインティング](https://blogcake.net/wp-content/uploads/2023/03/dalle2-inpating-1024x538.jpg)
DallE2のインペインティングは、既存の画像の一部分を消しごみで削除して、AIにプロンプトと呼ばれる指示文(プロンプト)を渡すと、AIが消した部分をプロンプトの通りに書き換えてくれる機能です。
これは、画像の一部分だけ修正を加えるのに有効な機能です。
たとえば、女性の絵の顔の一部を消して、表情だけ書き換えてもらったり、手ぶらのキャラクターの腕の先端を削除してハンドバッグを持たせたりすることができます。
DallE2のインペインティング(Inpainting)に必要なもの
DallE2のインペインティングには下記が必要です。
- OpenAIのアカウント(無料)
- 1回の生成につき1クレジット
アカウント新規作成時・あるいは毎月いくらかのクレジット無料配布があるので、無課金で試すことができます。
アカウントの作成方法は下記の記事で解説しています。
![](https://blogcake.net/wp-content/uploads/2022/11/dalle2-downsized-300x158.jpg)
DallE2のインペインティング(Inpainting)の方法!
![Dalleのトップページ](https://blogcake.net/wp-content/uploads/2023/03/2023-03-05_23h42_54.jpg)
▲DALL·E2(DALLE2)にアクセスして「Try Dalle」をクリックします。
サインインを求められるのでサインインします。
![Dalleの「Upload an image」](https://blogcake.net/wp-content/uploads/2023/03/2023-03-05_23h44_14-1024x172.jpg)
▲「Upload an Images」をクリックします。
![DallE2のインペインティング](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_21h48_59.jpg)
▲ダイアログが開くので画像を選択します。
![DallE2のインペインティング](https://blogcake.net/wp-content/uploads/2023/03/jojio_cute_Noh_face_wooden_mask_round_eyes_bear_round_face_whit_7d3aaf6f-de5d-4bda-8b90-4346bd4ef474.png)
▲今回使用する画像はこちらです。Midjourney(ミッドジャーニー)で生成したものです。
![DallE2のインペインティング](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_19h19_18.jpg)
▲トリミングが必要な場合はクロップします。正方形の画像しかインペインティングできませんので、横長・縦長の画像はここでクロップが必要です。
![DallE2のインペインティング](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_19h19_45.jpg)
▲「Edit Image」をクリックします。
![DallE2の消しゴムツール](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_19h20_09.jpg)
▲エディタが開きますので、画像の下にあるツールメニューの中の「消しゴムツール」をクリックして選択します。
![DallE2の消しゴムツール](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_19h20_53.jpg)
▲目のところを修正してみようと思うので、消しゴムツールで目のところを消してみます。図のような感じに消しました。
![DallE2 インペインティングのプロンプト](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_21h55_58.jpg)
▲消しゴムで消したところを補うプロンプト(AIへの指示文章)を書きます。
プロンプトについては「こちらの記事(DallE2の使い方)」をご覧ください。
ここでは下記のプロンプトを描きました。
Cute cat, round eyes
![DallE2 インペインティングの実行結果](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_19h42_52-1024x213.jpg)
▲プロンプトを書いたらエンターキーを押して少し待ちます。数秒後に4枚の画像が生成されます。
もともとにっこり細目から、プロンプトの通り、まん丸お目目に修正することができました。
気に入った場合は、各画像の左上の「Download」をクリックします。
「Genarate variations」をクリックすれば、その画像をもとにバリエーションを4枚生成することも可能です。
DallE2のインペインティング(Inpainting)の例!
![](https://blogcake.net/wp-content/uploads/2023/02/jojio-profile-small-150x150.jpg)
他にもいくつかインペインティングを試してみました。
![](https://blogcake.net/wp-content/uploads/2023/03/jojio_shy_mini_cat_hiding_in_a_peach_chubby_a5d6d51d-a352-4695-a771-e7d9b17986d7.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/jojio_shy_mini_cat_hiding_in_a_peach_chubby_a5d6d51d-a352-4695-a771-e7d9b17986d7.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_20h25_21.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_20h25_21.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/DALL·E-2023-03-06-19.49.58-piech.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/DALL·E-2023-03-06-19.49.58-piech.jpg)
▲左:Midjourneyで生成した画像、真ん中:消しゴムツールで消した画像、右:プロンプト「peach」でインペインティングした結果
桃の中にいた猫を閉じ込めることに成功しました。
![](https://blogcake.net/wp-content/uploads/2023/03/セーラームーン名称未設定のアートワーク.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/セーラームーン名称未設定のアートワーク.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_21h10_07.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_21h10_07.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/DALL·E-2022-10-31-01.22.43-cute-Sailor-Moon.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/DALL·E-2022-10-31-01.22.43-cute-Sailor-Moon.jpg)
▲左:私が描いた絵、真ん中:消しゴムツールで消した画像、右:プロンプト「cute Sailor Moon」でインペインティングした結果
私の画力ではセーラームーンの顔を上手に描くことができなかったのですが、DallE2の力を借りると近づくことができました。
![](https://blogcake.net/wp-content/uploads/2023/03/woman_wearing_fish_cap_editorial_fashion_photography_from__6f6ecc60-29b4-499b-872b-a00c9af74fef.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/woman_wearing_fish_cap_editorial_fashion_photography_from__6f6ecc60-29b4-499b-872b-a00c9af74fef.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_21h07_05.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_21h07_05.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/DALL·E-2023-03-06-21.08.12-fashion-model-many-fish-from-cap.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/DALL·E-2023-03-06-21.08.12-fashion-model-many-fish-from-cap.jpg)
▲左:Midjourneyで生成した画像、真ん中:消しゴムツールで消した画像、右:プロンプト「fashion model, many fish from cap」でインペインティングした結果
帽子から飛び出ていた魚を増やすことに成功しました。
![](https://blogcake.net/wp-content/uploads/2023/03/jojio_scottish_fold_moon_face_studio_shot_white_background_Bipe_c2a35f0e-5c20-4db8-9998-21bf8a6c361b.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/jojio_scottish_fold_moon_face_studio_shot_white_background_Bipe_c2a35f0e-5c20-4db8-9998-21bf8a6c361b.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_21h28_33.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/2023-03-06_21h28_33.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/DALL·E-2023-03-06-21.29.45-angel-wings.jpg)
![](https://blogcake.net/wp-content/uploads/2023/03/DALL·E-2023-03-06-21.29.45-angel-wings.jpg)
▲左:Midjourneyで生成した画像、真ん中:消しゴムツールで消した画像、右:プロンプト「cat, angel wings」でインペインティングした結果
midjourneyで生成した猫の画像に天使の羽を生やすことに成功しました。
まとめ
以上、DallE2のインペインティングでした。
このように外部の画像生成AIツールであるMidjourneyで生成した画像も、インペインティングで修正することができました。
コメント