 process, and you can use this same pattern to write any diffusion system. The last step is to convert the denoised output into an image:   Copied >>> from PIL import Image
>>> import numpy as np

>>> image = (input / 2 + 0.5).clamp(0, 1).squeeze()
>>> image = (image.permute(1, 2, 0) * 255).round().to(torch.uint8).cpu().numpy()
>>> image = Image.fromarray(image)
>>> image In the next section, you’ll put your skills to the test and breakdown the