All models

stackgan_stage2_g

Text-to-image GAN that sketches a low-res image, then a second stage refines it to 256×256.

Diffusion and generative · 92 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (25 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
57.2M
Operations
92
Framework
PyTorch
Recurrent
No
Published
ICCV 2017
Cited by
3,020 (as of 17 October 2026)
Authors
Han Zhang, Tao Xu, Hongsheng Li and others
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m10257
Graph hash
8477a9a4ff9f784ef8249a9cd2e94bebd9707fb2fd0e77ff2e5ffbdc7c9b5149
Skeleton hash
91b12825591c7fe83e217ad5aa868f48678ed4c94214132c20c2114d39e6039a
Architecture hash
cdec46b63ec662db88fec26944d71caf53725b329e2308db406de0160e18d1de
Diagram SHA-256
81dab8b3242078996dce703792041bdcf361e5053eae52a58a9b18860422f820
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

The Stage-II generator, an encoder-decoder with residual blocks that refines a Stage-I image conditioned on the text again.

About this model's family

StackGAN generates photo-realistic images from text descriptions by splitting the hard problem into two stages, in analogy to how a painter sketches and then refines. The Stage-I GAN sketches the primitive shape and colors of the object from the text and draws the background from a noise vector, yielding a low-resolution image. The Stage-II GAN takes the Stage-I result and the text again, corrects its defects and completes details, producing a high-resolution image.

The motivation is that simply adding upsampling layers to a text-conditioned GAN gives training instability and nonsensical outputs at high resolution. A roughly aligned low-resolution image makes the model distribution more likely to overlap the image distribution, which the authors give as the reason the second stage can succeed. Text enters as an embedding from a pre-trained encoder, passed through Conditioning Augmentation, which samples the conditioning vector from a Gaussian whose mean and covariance are functions of the embedding. A KL term to the standard Gaussian regularizes it, and the added randomness improves diversity and stabilizes training.

The Stage-I generator concatenates the conditioning vector with a noise vector and runs a series of up-sampling blocks. The Stage-II generator is an encoder-decoder with residual blocks: the Stage-I image is down-sampled, concatenated with spatially replicated text features, passed through residual blocks and up-sampled. No fresh noise is used in Stage-II, on the assumption that the randomness is already carried by the Stage-I result.

The captured members are generators only, from the authors' PyTorch code, which reproduces the paper's COCO results with a network structure slightly different from the TensorFlow implementation. That PyTorch release reports a higher inception score than the paper.

Key idea. StackGAN stacks a sketching Stage-I GAN and a refining Stage-II GAN, with Conditioning Augmentation on the text embedding, to generate 256×256 photo-realistic images from text descriptions.

  • stackgan
  • stacked generative adversarial networks
  • text to photo-realistic image synthesis
  • stage-i gan
  • stage-ii gan
  • conditioning augmentation
  • char-cnn-rnn text embedding
  • coco
  • cub birds
  • oxford-102 flowers

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{zhang2017stackgantextphotorealisticimage,
      title={StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generative Adversarial Networks}, 
      author={Han Zhang and Tao Xu and Hongsheng Li and Shaoting Zhang and Xiaogang Wang and Xiaolei Huang and Dimitris Metaxas},
      year={2017},
      eprint={1612.03242},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1612.03242}, 
}