QRコード風AI画像アートを検証する

スポンサーリンク
Stable Diffusion
スポンサーリンク

Twitterで話題のQRコード風のAI画像アートを検証します。ControlNetをうまく組み合わせるのがコツです。背景付きなどの変化させたコードはQRコードと呼んではいけないそうなので、「QRコード風AI画像アート」と呼びますが、スマホで読めるコードの生成を目指します。

作成手順と準備

作成にはControlNetのReference onlyとTile Resampleを使います。もし、それらが入っていない方はControlNetのアップデートとTileのモデルのダウンロードをお願いします。

参考記事1:進化したControlNet1.1のレビュー(Stable Diffusion Web UI)
参考記事2:ControlNetなどのWebUI拡張機能を最新版に更新する方法

今回は以下の手順で行います。

1.QRコードの準備
2.768×768で良さげな画像の準備
3.QRコードと画像をControlNetで合成

今回の検証では下のサイト(英語)を参考にさせていただいています。

QRコードの準備

QRコードは検索するとフリーのサイトで簡単に作ることができます。また、Pythonのライブラリ、「qrcode」でも簡単に作れます。Pythonで自分で作りたい方は記事にまとめましたので、少し難しいですが、挑戦してみてください。

参考記事:PythonでQRコードを作ってみる

ここでは、例として、当サイトのQRコードを生成して使います。

ベース画像の生成

好きなプロンプトで画像を生成します。サイズは768×768の正方形を使います。ここでは、checkpointとして、Anything4.5を使い、アニメ系の画像を生成しました。

multi controlnetの準備

controlnetの準備ができているか確認します。今回はmulti controlnetを使います。

multi controlnetを使うためには設定を変える必要があります。「設定(settings)」から「controlnet」を開いて、multi controlnetを2以上に設定して、「設定を適用(Apply settings)」のボタンを押したあと、Stable Diffusion WebUIを終了させて、再起動しましょう。

QRコード風のAI画像アートの生成

それではQRコード風の画像を生成します。画像生成の条件は先ほどベース画像を生成した時に使ったプロンプトや画像サイズをそのまま使います。シードも同じにしておいた方が安定します。

主な設定項目は以下の通りです。詳細は画像をご確認ください。
プロンプト:元画像の生成条件と同じ
画像サイズ:768×768
step数:60

ControlNet Unit 0
・使う画像:上で生成したベース画像
・使うcontrolnetモデル:reference only
・control weight:1
・starting control step:0
・ending control step:1

ControlNet Unit 1
・使う画像:上で生成したQRコード画像
・使うcontrolnetモデル:tile resample
・control weight:1.2
・starting control step:0.4
・ending control step:1

ControlNet Unit0の設定

ControlNet Unit1の設定

生成画像

このようになりました。私のスマホで確認したところ、問題なくQRコードを認識できました。もう少し攻めた画像にしてもQRコードを認識できるようですが、何となくQRコードが画像と溶け込んでいておしゃれですね。

ギャラリー

ControlNet Unit0に20ステップで生成した画像、その他はQRコードを置く。一応、すべて読めた。周りの3つの四角さえはっきりしていれば、大抵読み取ってもらえそう。参考までに、生成情報付きでおいておきます。

1girl, solo, Sunflowers fields in Kansas, embressed, (RAW photo, best quality), (realistic, photo-realistic:1.3), masterpiece, an extremely delicate and beautiful, extremely detailed, CG, unity , 2k wallpaper, finely detail, light smile, extremely detailed CG unity 8k wallpaper, huge filesize, ultra-detailed, highres
Negative prompt: EasyNegative, bad-image-v2-39000, badhandv4, ulzzang-6500-v1.1, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans, extra fingers, fewer fingers, ((watermark:2)), (white letters:1), (multi nipples), bad anatomy, bad hands, text, error, missing fingers, missing arms, missing legs, extra digit, fewer digits, cropped, worst quality, jpeg artifacts, signature, watermark, username, bad feet, {Multiple people}, blurry, poorly drawn hands, poorly drawn face, mutation, deformed, extra limbs, extra arms, extra legs, malformed limbs, fused fingers, too many fingers, long neck, cross-eyed, mutated hands, polar lowres, bad body, bad proportions, gross proportions, wrong feet bottom render, abdominal stretch, briefs, knickers, kecks, thong, {{fused fingers}}, {{bad body}}, bad-picture-chill-75v, ng_deepnegative_v1_75t, EasyNegative, bad proportion body to legs, wrong toes, extra toes, missing toes, weird toes, 2 body, 2 pussy, 2 upper, 2 lower, 2 head, 3 hand, 3 feet, extra long leg, super long leg, mirrored image, mirrored noise, (bad_prompt_version2:0.8), aged up, old, ((mosaic))
Steps: 60, Sampler: DPM++ SDE Karras, CFG scale: 7, Seed: 2174782436, Face restoration: CodeFormer, Size: 768x768, Model hash: 5bc5a45624, Model: BracingEvoMix_v1, ControlNet 0: "preprocessor: reference_only, model: None, weight: 1, starting/ending: (0, 0.8), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 0.5, 64)", ControlNet 1: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1, starting/ending: (0.4, 1), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)", ControlNet 2: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1.2, starting/ending: (0.65, 1), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)"
1girl, solo, embressed, (RAW photo, best quality), (realistic, photo-realistic:1.3), masterpiece, an extremely delicate and beautiful, extremely detailed, CG, unity , 2k wallpaper, Amazing, finely detail, light smile, extremely detailed CG unity 8k wallpaper, huge filesize, ultra-detailed, highres, outdoor, desert, big breasts
Negative prompt: EasyNegative, bad-image-v2-39000, badhandv4, ulzzang-6500-v1.1, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans, extra fingers, fewer fingers, ((watermark:2)), (white letters:1), (multi nipples), bad anatomy, bad hands, text, error, missing fingers, missing arms, missing legs, extra digit, fewer digits, cropped, worst quality, jpeg artifacts, signature, watermark, username, bad feet, {Multiple people}, blurry, poorly drawn hands, poorly drawn face, mutation, deformed, extra limbs, extra arms, extra legs, malformed limbs, fused fingers, too many fingers, long neck, cross-eyed, mutated hands, polar lowres, bad body, bad proportions, gross proportions, wrong feet bottom render, abdominal stretch, briefs, knickers, kecks, thong, {{fused fingers}}, {{bad body}}, bad-picture-chill-75v, ng_deepnegative_v1_75t, EasyNegative, bad proportion body to legs, wrong toes, extra toes, missing toes, weird toes, 2 body, 2 pussy, 2 upper, 2 lower, 2 head, 3 hand, 3 feet, extra long leg, super long leg, mirrored image, mirrored noise, (bad_prompt_version2:0.8), aged up, old, ((mosaic))
Steps: 60, Sampler: DPM++ SDE Karras, CFG scale: 7, Seed: 3279979293, Size: 768x768, Model hash: 5bc5a45624, Model: BracingEvoMix_v1, ControlNet 0: "preprocessor: reference_only, model: None, weight: 1, starting/ending: (0, 0.8), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 0.5, 64)", ControlNet 1: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1.1, starting/ending: (0.4, 1), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)", ControlNet 2: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1.2, starting/ending: (0.7, 1), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)"
1girl, solo, Sakura blossoms in Tokyo, embressed, (RAW photo, best quality), (realistic, photo-realistic:1.3), masterpiece, an extremely delicate and beautiful, extremely detailed, CG, unity , 2k wallpaper, finely detail, light smile, extremely detailed CG unity 8k wallpaper, huge filesize, ultra-detailed, highres
Negative prompt: EasyNegative, bad-image-v2-39000, badhandv4, ulzzang-6500-v1.1, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans, extra fingers, fewer fingers, ((watermark:2)), (white letters:1), (multi nipples), bad anatomy, bad hands, text, error, missing fingers, missing arms, missing legs, extra digit, fewer digits, cropped, worst quality, jpeg artifacts, signature, watermark, username, bad feet, {Multiple people}, blurry, poorly drawn hands, poorly drawn face, mutation, deformed, extra limbs, extra arms, extra legs, malformed limbs, fused fingers, too many fingers, long neck, cross-eyed, mutated hands, polar lowres, bad body, bad proportions, gross proportions, wrong feet bottom render, abdominal stretch, briefs, knickers, kecks, thong, {{fused fingers}}, {{bad body}}, bad-picture-chill-75v, ng_deepnegative_v1_75t, EasyNegative, bad proportion body to legs, wrong toes, extra toes, missing toes, weird toes, 2 body, 2 pussy, 2 upper, 2 lower, 2 head, 3 hand, 3 feet, extra long leg, super long leg, mirrored image, mirrored noise, (bad_prompt_version2:0.8), aged up, old, ((mosaic))
Steps: 60, Sampler: DPM++ SDE Karras, CFG scale: 7, Seed: 2174782434, Size: 768x768, Model hash: 5bc5a45624, Model: BracingEvoMix_v1, ControlNet 1: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 0.6, starting/ending: (0.4, 1), resize mode: Resize and Fill, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)", ControlNet 2: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1.2, starting/ending: (0.7, 1), resize mode: Resize and Fill, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)", ControlNet 3: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1, starting/ending: (0, 1), resize mode: Crop and Resize, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)"
(illustration:1.0), masterpiece, best quality, 1girl, solo, smile, pure face, looking at veiwer, big breasts, standing, The beaches of Maui, pixie cut
Negative prompt: EasyNegative, nsfw, (worst quality, low quality:1.4), (depth of field, blurry, bokeh:1.5), (greyscale, monochrome:1.0), multiple views, text, title, logo, signature, (tooth, lip, nose, 3d, realistic:1.0), dutch angle,(cropped:1.4), text, title, signature, logo,( loli:1.2), school satchel, pink,school bag, school uniform, from behind
Steps: 60, Sampler: DPM++ SDE Karras, CFG scale: 7, Seed: 1411331124, Size: 768x768, Model hash: f773383dbc, Model: アニメ系_anything-v4.5-pruned-fp16, ControlNet 0: "preprocessor: reference_only, model: None, weight: 1, starting/ending: (0, 0.8), resize mode: Resize and Fill, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 0.5, 64)", ControlNet 1: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1, starting/ending: (0.4, 1), resize mode: Resize and Fill, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)", ControlNet 2: "preprocessor: tile_resample, model: control_v11f1e_sd15_tile [a371b31b], weight: 1.2, starting/ending: (0.8, 1), resize mode: Resize and Fill, pixel perfect: False, control mode: Balanced, preprocessor params: (64, 1, 64)"

コメント