You can use a pre-trained GAN model in PyTorch to generate images, here is the code snippet you can refer:
![](https://www.edureka.co/community/?qa=blob&qa_blobid=6545154284312934440)
In the above code, we are using Latent Vectors (z) that randomize noise input sampled from a standard normal distribution (torch.randn), a Pretrained Model that Loads your pretrained generator using the torch.load, Normalization, which scales output images from [-1, 1] to [0, 1] for saving, and Saving Images, which uses torchvision.utils.save_image for easy visualization.
Hence referring to the above, you can code to generate images using a pre-trained GAN model in PyTorch.