The goal of this project is to further my understanding of image representation and manipulation, and produce large sections of image that is the product of multiple individual images stitched together.
We first set up the diffusion model. The random seed used for this project is 61.
To start off, we introduce noise into our test image with the forward process.
To start denoising, we can first try the classical gaussian blur filtering.
Now, we can actually use the diffusion model to denoise the images. We can start off by using one step denoising.
Diffusion models are designed to denoise iteratively. In this part we will implement this.
In part 1.4, we use the diffusion model to denoise an image. Another thing we can do with the iterative_denoise function is to generate images from scratch.
In order to greatly improve image quality (at the expense of image diversity), we can use a technicque called Classifier-Free Guidance.
In part 1.4, we take a real image, add noise to it, and then denoise. This effectively allows us to make edits to existing images. Here, we're going to take the original test image, noise it a little, and force it back onto the image manifold without any conditioning. Effectively, we're going to get an image that is similar to the test image (with a low-enough noise level).
This procedure works particularly well if we start with a nonrealistic image (e.g. painting, a sketch, some scribbles) and project it onto the natural image manifold.
We can use the same procedure to implement inpainting.
Now, we will do the same thing as SDEdit, but guide the projection with a text prompt.
In this part, we will create an image that looks like "an oil painting of people around a campfire", but when flipped upside down will reveal "an oil painting of an old man".
In this part we'll implement Factorized Diffusion and create hybrid images just like in project 2.