Next, generate some initial random noise as a starting point for the diffusion process. This is the latent representation of the image, and it'll be gradually denoised. At this point, the `latent` image is smaller than the final image size but that's okay though because the model will transform it into the final 512x512 image dimensions later.  
<Tip>  
💡 The height and width are divided by 8 because the `vae` model has 3 down-sampling layers. You can check by running the following:  
```py
2 ** (len(vae.config.block_out_channels) - 1) == 8
```  
</Tip>  
```py
>>> latents = torch.randn(
...     (batch_size, unet.config.in_channels, height // 8, width // 8),
...     generator=generator,
...     device=torch_device,
... )
```
/Users/nielsrogge/Documents/python_projecten/diffusers/docs/source/en/using-diffusers/write_own_pipeline.md