Chapter Two

#How does AI Imaging work?

Stable Diffusion, Dall-E and Midjourney at an Art Workshop. Image by Amar Vyas, created using Stable Diffusion 2.1
Stable Diffusion, Dall-E and Midjourney in an Art Workshop. Created using Stable Diffusion 2.1

For the sake of simplicity, I am going to limit the explanation to this question to the two below paragraphs. This will help the novices or those who are not familiar with the world of AI Image technology, to get a fair idea about this very interesting topic.

For those who are interested in learning more, please visit the wikipedia pages for Stable Diffusion, Midjourney, Dreambooth and Dall-e. These are excellent starting points, and I am sure there is much more information available about this space, in the public domain as well as peer reviewed journals. Understanding the science behind AI image creation is not the objective or goal for this book. The art, possibly yes. 

If you are keen on learning a bit more about AI Image techniques, the last part of this segment might be relevant. Otherwise, let us move on to the next section which deals with methods and techniques for AI Image generation.

#Methods and Techniques for Image generation

I mentioned three or four different sites in the previous section for generating images using AI. These are: Dall-e-2, Midjourney, Stable Diffusion and Dreambooth. But when it ocmes to image generation techniques, there are a few algorithms or techniques that are used more commonly than others. To get a fair idea about the different techniques, I would encourage you to first visit Nightcafe.

In the image creation page for NightCafe you will find terms such as Clip and VQGAN+Clip. Others image generation techniques include StyleGAN and BigGAN, CartoonGAN and Latent Diffusion. Suffice to say there are several different methods and techniques used by different Apps or sites to generate images using AI. 

GAN is an acronym which stands for Generative Adversarial Networks

Spaces on Huggingface that use different Diffusion based Image generation models
Spaces on Huggingface that show Diffusion based Image generation models
NightCafe offers four different AI image generation models.
NightCafe offers four different AI image generation models

Each of the above models can lead to projects that are based on their underlying algorithms. Many of the AI Imaging models are open source, which means that people can create AI image creation engines for specific art form or versions of a particular image generation technique. e.g. AnimeGAN is derived from GAN.

Screenshot of an AI image generated using AnimeGAN on Huggingface, by skytnt
Screenshot of an AI image generated using AnimeGAN on Huggingface, by skytnt

You may also find open source versions of Image generation sites on Huggingface. One such example is called Openjourney by Prompthero. This is based on Midjourney, and as per their github page,

OpenJourney is a Text-to-Image AI model which has the goal of bringing an open source equivalent to Midjourney to the people. It is currently based on prompthero/midjourney-v4-diffusion and is under further developments by Muhammadreza Haghiri to get closer results to Midjourney AI.

Which beings us to the next part: Which sites and apps will help you create Images using AI? 

#Sites and Apps for creating images using AI

Most sites or Apps I have encountered use the open source Stable Diffusion based tools, or its variants. Others use Dall-E or Midjourney. Many of the 100 odd imageing sites or apps that I have listen in Chapter V (chapter-v-list-ai-image-sites) use one or more of the techniques mentioned above. Some may use propreitory algorithms. Some content optimization tools such as Nichesss, an AI content generation and optimization site, uses Dall-e-2 for AI image generation.

#Beyond Image Generation

AI tools are not just used for generating images. Some other applications include enhancing the quality of images, removing background of images, creating a portfolio of profile pictures, and so on. To summarize, the applications of AI imaging beyond image generation include some of the following

Click on any of the links in the above section to visit that page where we discuss the application of AI imaging in a bit more detail.

I am sure you must be cringing by now- and wondering, when will we actually get to see, explore, and learn about creating images using AI? That's exactly what we will do in the next sections.

If you would like to see more examples of AI generated images, you may want to move on to Chapter III .

Otherwise, calm down, admire the beautiful puppies in the image below.


Tinywow is one of the several sites where you can generate AI Images

If you would like to get a 30 second summary of what AI based image generation is, here is one (thanks, chatGPT!):

Text to image technology is a type of artificial intelligence (AI) that allows a computer to generate an image based on a given text description. This technology is commonly used in natural language processing (NLP) applications, where the goal is to enable computers to understand and interpret human language.

Which beings us to the next important question: Which sites and apps will help you create Images using AI? We will explore and find the answer in Chapter III. Below images were generated from two such sites.

Cityscape-3 LES2
Cityscape in the 1960s, sepia. ( portrait of a young woman, oil painting (Thumbsnap)

#Optional Reading: A bit more about AI Imaging

One of the goals of using AI-based image generation is to create images that are high-quality, and images that can be used for a variety of purposes. The purposes or applications of AI imaging are many, and like we discussed previously, they may include generating new images for a project, creating photo realistic images for use in portfolio or video games, or even generating images for artistic, scientific, industrial and medical purposes.

AI-based image generation typically works by using a type of machine learning algorithm which is called as a generative model. This type of algorithm is developed by training on a large number of images. Sometimes the training data set may running into millions of images!

The algorithm uses existing images to learn one or more aspects of imaging: art forms, styles, colours, characteristics of subjects in the image, materials used, dimensions, lighting. In other words the focus is on understanding patterns and features that define different types of images. Once the model is trained, it can then generate or create new images by applying the patterns it has learned to create unique images. In most cases, the image generation process relies on the intelligence that the algorithm has gathered from existing images. This process is often called "image synthesis" or "image generation."

SD-MJ-Dall-e-Admiring-Art. Image by Amar Vyas using Thumbsnap
Robots admiring a work of art. Concept image generated using Thumbsnap

© by Amar Vyas, 2022 - 2023. All Rights Reserved. Built with Typemill.