``Multi-subject-render'' that can create a ``composition where multiple characters fit in one scene'' that was difficult to create with the image generation AI ``Stable Diffusion''
With the image generation AI 'Stable Diffusion', it is difficult to create an image that includes multiple subjects. In order to solve this problem, a script `` multi-subject-render '' that can execute a feat of `` generating the background image and the subject image separately and combining them with the power of AI '' has been released. I tried it.
GitHub - Extraltodeus/multi-subject-render: Generate entire harems of waifus using stable diffusion easily
multi-subject-render is distributed as an extension of the GUI 'Stable Diffusion web UI (AUTOMATIC1111 version)' that makes it easy to use Stable Diffusion. The installation procedure for Stable Diffusion web UI (AUTOMATIC1111 version) is explained in detail in the following article.
Image generation AI ``Stable Diffusion'' works even with 4 GB GPU & various functions such as learning your own pattern can be easily operated on Google Colabo or Windows Definitive edition ``Stable Diffusion web UI (AUTOMATIC 1111 version)'' installation method summary - GIGAZINE
After starting the Stable Diffusion web UI (AUTOMATIC1111 version), move to the 'Extensions' tab, select 'Install from URL', and enter ' https://github.com/Extraltodeus/multi-subject- render and then click Install.
Then go to 'Installed' and make sure 'multi-subject-render' is displayed, then click 'Apply and restart UI'.
After restarting the Stable Diffusion web UI (AUTOMATIC1111 version), you will be able to select 'Multi Subject Rendering' in the script selection field at the bottom of the txt2img tab.
The procedure for image generation using multi-subject-render looks like this. First, enter the background image prompt in the normal prompt entry area. This time, I entered ' a beach, sunny sky '.
Next, enter the prompt of the subject you want to generate in 'Foreground prompt' in Multi Subject Rendering, select the number of subjects in 'Number of foreground images', and then set the resolution of the generated image in 'blend width/blend height' Specify At this time, if you enter ' , (bokeh), (F1.8: 1.2) ' at the end of the prompt, it will be easier to cut out the subject. This time, I entered the prompt ' standing dog, full body, (bokeh), (F1.8:1.2) ', set the number of subjects to 2, and set the resolution to 1024 x 512.
After that, just click 'Generate' to generate the image. It will take several minutes to complete the generation because the download of the necessary data will start for the first time.
The generated result is below. I was able to draw two dogs with the sandy beach as the background, but the ground that is different from the sandy beach remained at the feet of the dogs.
Presuming that it is difficult to cut out the dog's feet, this time enter the prompt ' standing dog, full body, a beach, sunny sky, (bokeh), (F1.8: 1.2) ' in the 'Foreground prompt' I tried to generate a sandy beach at the feet of .
The generated result looks like this. As intended, we were able to generate an image of two dogs standing on a sandy beach.
Below is the image generated by changing 'Number of foreground images' to 4 in the above settings. Although I succeeded in drawing four dogs, part of the dog was missing. If you generate many images or devise prompts, it seems that you can generate the desired image.
Waifu-Diffusion ', which specializes in illustrations, and entered 'classroom' in the prompt input field to make the background image a classroom.
This time, I switched the model data to '
In addition, 'Foreground prompt' has ' 1girl , solo, smile, bow, jacket, :d, hairband, bowtie, bangs, blazer, shirt, purple eyes, open mouth, school uniform, looking at viewer, purple hair, upper body , blue jacket, long sleeves, short hair, (bokeh), (F1.8:1.2) ”.
The image generation result looks like this. I was able to generate an image with two girls in the classroom as instructed.
When entering prompts in 'Foreground prompt', you can specify prompts for each object to be generated by entering multiple prompts with line breaks. This time, insert a line break right after the above prompt , then write '1girl, solo, smile, bow, jacket, :d, hairband, bowtie, bangs, blazer, shirt, green eyes, school uniform, looking at viewer, black I tried adding the prompt ' hair, upper body, blue jacket, long sleeves, long hair, (bokeh), (F1.8:1.2) '.
The generated result looks like this. I was able to capture girls with different hairstyles and hair colors in one image.