ControlNet is a deep learning model that helps in controlling the image generation of Stable Diffusion models. For example, with the help of ControlNet, we can use a pose of a person and use it generate different types of images with each image having someone in the same pose.
Source: huggingface.co/blog/controlnet
In addition to using pose, we can also use other properties of an image in ControlNet to control image generation, such as the depth of the objects, edges in the image, or segmenting the image into different objects.
In this tutorial, we will use ControlNet with Python, but you can also use ControlNet with the no-code tool
Automatic1111
.
Major libraries used in the code
Apart from the usual libraries like numpy, os, PIL, and matplotlib, we will also use the following libraries: