zai-org/CogView2

★ 951⑂ 85

official code repo for paper "CogView2: Faster and Better Text-to-Image Generation via Hierarchical Transformers"

About zai-org/CogView2

zai-org/CogView2 is an open-source project on GitHub, mainly written in Python. official code repo for paper "CogView2: Faster and Better Text-to-Image Generation via Hierarchical Transformers" It currently holds 951 stars and 85 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the AI Image Projects board and on the AI AI Image Projects list.

GitHub Repository Details

Repository zai-org/CogView2 · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

Generate vivid Images for Chinese / English text

CogView2 is a hierarchical transformer (6B-9B-9B parameters) for text-to-image generation in general domain. This implementation is based on the SwissArmyTransformer library (v0.2).

@article{ding2022cogview2,
  title={CogView2: Faster and Better Text-to-Image Generation via Hierarchical Transformers},
  author={Ding, Ming and Zheng, Wendi and Hong, Wenyi and Tang, Jie},
  journal={arXiv preprint arXiv:2204.14217},
  year={2022}
}

Web Demo

Getting Started

Setup

git clone https://github.com/Sleepychord/Image-Local-Attention
cd Image-Local-Attention && python setup.py install
If you don't install this kernel, you can also run the first stage (20*20 tokens) via --only-first-stage for text-to-image generation.

Download

Our code will automatically download or detect the models into the path defined by envrionment variable SAT_HOME. You can download from here and place them (folders named coglm/cogview2-dsr/cogview2-itersr) under SAT_HOME.

Text-to-Image Generation

./text2image.sh --input-source input.txt
Arguments useful in inference are mainly: You'd better specify a environment variable SAT_HOME to specify the path to store the downloaded model.

Chinese input is usually much better than English input.

Text-guided Completion

./text_guided_completion.sh --input-source input_comp.txt
The format of input is text image_path h0 w0 h1 w1, where all the separation are TAB (NOT space). The image at image_path will be center-cropped to 480*480 pixels and mask the square from (h0,w0)to (h1,w1). These coordinations are range from 0 to 1. The model will fill the square with object described in text. Please use a square much larger than the desired region. https://github.com/zai-org/CogView2/blob/HEAD/comp_pipeline

Gallery

more_samples

GitHub Stars & Activity

951Stars
85Forks
0Open issues
PythonLanguage

GitHub Popularity

GitHub stars951
Forks85
Open issues0
Primary languagePython
License-
Stars gained today0
Created-
Last pushed-

Trending History

Trending statusnot on today's boards

Related AI Projects

1

ultralytics / ultralytics

Python★ 61,829⑂ 11,787
2

ultralytics / yolov5

Python★ 58,057⑂ 17,469
3

roboflow / supervision

Python★ 50,960⑂ 4,848
4

lucidrains / vit-pytorch

Python★ 25,514⑂ 3,495
5

junyanz / pytorch-CycleGAN-and-pix2pix

Python★ 25,244⑂ 6,567
6

graphdeco-inria / gaussian-splatting

Python★ 23,930⑂ 3,434
7

pytorch / vision

Python★ 17,921⑂ 7,265
8

cvat-ai / cvat

Python★ 16,758⑂ 3,871

More AI Rankings