Downloads · 30 days
0
mediasynthesismuseum/attngan-coco
attngan-coco is a text-to-image model from mediasynthesismuseum. Use it when you need an image from a text prompt. It is set up for pytorch. The card lists the license as mit.
The original AttnGAN COCO text-to-image model — AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks (Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huan…
Downloads · 30 days
0
Access
Public
Updated Jul 6, 2026
Repo size
115 MB
Likes
0
Public
Click a slice to open those files.
.pth90 MB · 78%
From the Hugging Face model README
The original AttnGAN COCO text-to-image model — AttnGAN: Fine-Grained Text to Image Generation
with Attentional Generative Adversarial Networks (Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han
Zhang, Zhe Gan, Xiaolei Huang, Xiaodong He). One of the landmark pre-diffusion text-to-image models:
a DAMSM text encoder feeds a 3-stage attentional generator (64→128→256) that attends to
individual words while drawing. Powers
mediasynthesismuseum/attngan-coco.
These are the original pretrained weights from taoxugit/AttnGAN (Google-Drive-hosted, mirrored here for preservation), runnable on modern PyTorch.
coco_AttnGAN2.pth — the 3-stage generator G_NET (GF_DIM=48, R_NUM=3, Z_DIM=100).text_encoder100.pth — the DAMSM bi-LSTM RNN_ENCODER (EMBEDDING_DIM=256).captions.pickle — COCO caption metadata; provides ixtoword/wordtoix (vocab 27,297).model.py, GlobalAttention.py — the network definitions.cfg.GAN.GF_DIM=48; cfg.GAN.R_NUM=3; cfg.TREE.BRANCH_NUM=3 # COCO config
text_encoder = RNN_ENCODER(27297, nhidden=256); text_encoder.load_state_dict(torch.load("text_encoder100.pth"))
netG = G_NET(); netG.load_state_dict(torch.load("coco_AttnGAN2.pth"))
# tokenize caption via wordtoix -> text_encoder -> netG(noise, sent_emb, words_embs, mask)
# final image = fake_imgs[-1] (256x256, in [-1,1])
Output is impressionistic 256×256 (authentic to 2018) — it captures objects/scene/colour from the caption. Credit: the AttnGAN authors; built on StackGAN (Han Zhang et al.).