SuperAPI AI Directory

CogView4 - Zhipu's open-source AI text-to-image model that supports generating Chinese characters

Author: AI小集 · Original source: AI工具集

What is CogView4

CogView4 is an open-source text-to-image model launched by Zhipu, with 6 billion parameters, supporting native Chinese input and Chinese text generation. The model ranks first overall in the DPG-Bench benchmark, reaching the state-of-the-art (SOTA) level among open-source text-to-image models. CogView4 is the first to follow the Apache 2.0 licenseimage generationmodel, CogView4 supports image generation at arbitrary resolutions and can generate high-quality images based on complex text descriptions.

CogView4

Main features of CogView4

  • Supports Chinese-English bilingual input: CogView4 is the first open-source text-to-image model that supports generating Chinese characters, and can generate high-quality images based on Chinese or English prompts.
  • Arbitrary-resolution image generation: The model supports generating images with resolutions between 512×512 and 2048×2048, meeting the creative needs of different scenarios.
  • Powerful semantic alignment capability: In the DPG-Bench benchmark, CogView4 ranks first overall, demonstrating its excellent performance in complex semantic alignment and instruction following.
  • Chinese text rendering: CogView4 has specially optimized Chinese text generation capability, and can naturally integrate Chinese characters into images, making it suitable for creative fields such as advertising and short videos.
  • VRAM optimization and efficient inference: Through technologies such as model CPU offloading and text encoder quantization, CogView4 significantly reduces VRAM usage and improves inference efficiency.

Technical principles of CogView4

  • Architecture design: CogView4 adopts an architecture that combines a diffusion model with a Transformer. The diffusion model generates images by gradually removing noise, while the Transformer handles the joint representation of text and images. The model uses a 6B parameter configuration and supports text input of arbitrary length and image generation at arbitrary resolutions.
  • Text encoder and Tokenizer: CogView4 uses a bilingual (Chinese-English) GLM-4 encoder and can handle complex semantic alignment tasks. Text is converted into embedding vectors through the Tokenizer, and then combined with the latent representation of the image.
  • Image encoding and decoding: Images are encoded into representations in latent space through a Variational Auto-Encoder (VAE), and the final image is generated through gradual denoising by the diffusion model. This enables the model to efficiently handle image generation tasks.
  • Diffusion process and denoising: The core of the diffusion model is to gradually generate images through a series of denoising steps. CogView4 uses the FlowMatch Euler Discrete Scheduler to control the denoising process, and users can adjust the number of denoising steps (num_inference_steps) to balance generation quality and speed.
  • Multi-stage training strategy: CogView4 adopts a multi-stage training strategy, including base-resolution training, generalized-resolution training, high-quality data fine-tuning, and human preference alignment training. This ensures the high quality and aesthetics of the generated images.
  • Optimization and efficiency: To improve training and inference efficiency, CogView4 adopts VRAM optimization technologies such as model CPU offloading and text encoder quantization. The model supports the Apache 2.0 license, facilitating further development by the open-source community.

CogView4 project address

Official cases of CogView4

  • Super-long story (four-panel comic):Please generate an image containing a four-panel comic strip with four scenes, in a comic-book style with anime illustration aesthetics. The main characters appearing in it are: Xiaoming: a human boy with a brave heart, holding a sword and wearing simple warrior clothing. Princess: a human female, beautiful and elegant, wearing gorgeous princess attire, imprisoned in the monster's lair. King: a human male, majestic and benevolent, wearing gorgeous royal attire, sitting on the throne of the kingdom. Flame Dragon: a monster, with scales like flames covering its entire body, breathing fire from its mouth, enormous in size. Dark Demon King: a monster, gigantic in size, shrouded entirely in darkness, possessing powerful magical abilities.
CogView4
  • CogView4 can naturally integrate Chinese and English characters into the image, making the creation of posters and copy illustrations more convenient.
  • It is skilled at understanding and following Chinese prompts, for example, being able to depict the imagery in ancient Chinese poetry and prose.

Application scenarios of CogView4

  • Advertising and Creative Design: CogView4 can naturally integrate Chinese and English characters into the image, generating high-quality posters, copy illustrations, etc., meeting the needs of the advertising and creative design fields.
  • Educational Resource Generation: The model can generate teaching illustrations, scientific illustrations, etc. for the education field, helping students better understand and absorb knowledge.
  • Children's Picture Book Creation: CogView4 can generate illustrations suitable for children's picture books, stimulating children's imagination.
  • E-commerce and Content Creation: Generate high-quality product images, advertising posters, etc., helping merchants quickly create attractive visual content.
  • Personalized Customization: Generate customized image content according to user needs, enhancing the user experience.