``ImaginAIry'' that can execute image generation by image generation AI ``Stable Diffusion'' and face resolution enhancement with a single command

The image generation AI 'Stable Diffusion' generates your favorite image just by entering a sentence (prompt), but when using Stable Diffusion in the local environment, complicated initial settings are required. With the open source Python package ` ` ImaginAIry '', you can easily build an image generation environment using Stable Diffusion with pip. Since it seems to be convenient, I tried to summarize the function.

GitHub - brycedrennan/imaginAIry: AI imagined images. Pythonic generation of stable diffusion images.


ImaginAIry is a Python script that supports 'Linux' and 'macOS with Rust and setuptools-rust installed', and can be installed quickly by executing the following command.
[code]pip install imaginairy[/code]

After installing ImagineAIry, all you have to do is execute a command of the form ' imagine 'prompt' ' to generate an image. Multiple prompts can be specified at the same time. It specifies four prompts: 'portrait photo of a freckled woman.'
[code]imagine 'a scenic landscape' 'a photo of a dog' 'photo of a fruit bowl' 'portrait photo of a freckled woman'[/code]

Below are the four images generated by the above command. Image generation by Stable Diffusion can be performed in a very simple procedure.

ImaginAIry also has a built-in ' InstructPix2Pix ' function that allows you to perform image editing by prompting. You can edit image files with .

For example, if you want to edit the dog photo (dog.jpg) generated by the above command to ``make the dog red'', execute the following command.
[code]aimg edit dog.jpg 'make the dog red' --prompt-strength 5[/code]

When the image before editing (left) and the image after editing (right) are arranged side by side, it looks like this. Only the dog part is red, as specified in the prompt

In addition, ImagineAIry is equipped with a 'function to clarify human faces' using ' CodeFormer '. An example of a command to clarify the face is as follows.
[code]imagine 'a couple smiling' --steps 40 --seed 1 --fix-faces[/code]

Below is an image showing the result of editing by the above command. By moving the slide bar, you can compare the difference between before editing (left) and after editing (right).

ImaginAIry also has other functions such as ' img2img ' that inputs images and outputs similar images, and a function that arranges images in tiles.

in Software, Posted by log1o_hf