OpenViSTAI · Agents · Blockchain · Crypto
Menu
Image & Video AI

GANformer

GANformer is Python research code for generating images with a generative adversarial transformer. It provides TensorFlow and PyTorch implementations, pretrained checkpoints, and scripts for image generation, model training, and evaluation.

Independent OpenViST project profile, based on linked sources.

GANformer — OpenViST project profile in Image & Video AI.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use GANformer when you need research code for image generation with a transformer-based GAN, or want to examine its training, evaluation, and pretrained-model workflows.

Who it is for

  • Researchers studying generative models, transformer architectures, or compositional image generation.
  • Developers who want to generate images from the included pretrained GANformer models.
  • Practitioners comparing TensorFlow and PyTorch implementations of a generative adversarial transformer.

Documented uses

  • Generate images from a pretrained checkpoint and save them to an output directory.
  • Adjust the generation quality–diversity trade-off with the truncation setting.
  • Train or evaluate a GANformer model using the repository's scripts.
  • Study how latent components and image features interact during synthesis.
Before you choose

Requirements & limits

The repository is public and identifies its license as MIT.

  • Choose between the TensorFlow implementation and the separate PyTorch version; the documented framework requirements differ.
  • The custom TensorFlow/PyTorch operations compile with NVCC, so CUDA setup is part of the environment requirements.
  • The README assumes 12 GB of GPU memory and reports experiments on a Titan V GPU.
  • The 1024 × 2048 Cityscapes generation example is documented for the TensorFlow version only.
  • The repository lists pretrained models at 256 × 256 across datasets, plus 1024 × 1024 FFHQ and 1024 × 2048 Cityscapes checkpoints.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Generate images from a pretrained bedroom model

Use the documented generation script and pretrained bedroom checkpoint to create 32 images.

Before you start

  • A local GANformer checkout and its Python package requirements installed.
  • A compatible TensorFlow or PyTorch setup; Python 3.6 or 3.7 is supported.
  • CUDA toolkit and cuDNN environment for the custom operations; the README documents CUDA 10.0 and cuDNN 7.5, and assumes 12 GB of GPU memory.

Steps

  1. Run the generation script with the documented checkpoint and output options: the command below.

    Documented command
    python generate.py --gpus 0 --model gdrive:bedrooms-snapshot.pkl --output-dir images --images-num 32
  2. Optionally set --truncation-psi to adjust the quality–diversity trade-off; the README recommends experimenting between 0.6 and 1.0.

Expected outcome

The script downloads a pretrained model and generates images in the specified output directory.

Guide limitations

  • The README describes CUDA custom operations and notes that a failed PyTorch kernel build can use a slower reference implementation.
  • The documented memory assumption is 12 GB of GPU memory; actual performance may vary.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
18 October 2026
Original website title
dorarad/gansformer · Official homepage title · retained in its source language