To reduce VRAM usage during diffusion-based image synthesis, you can use gradient checkpointing.
Here is the code snippet you can refer to:

In the above code, we are using the following key points:
Hence, this method allows for efficient memory usage without compromising model performance.