zai-org / GLM-Image

huggingface.co
Total runs: 9.5K
24-hour runs: 0
7-day runs: -1.8K
30-day runs: -262
Model's Last Updated: January 15 2026
text-to-image

Introduction of GLM-Image

Model Details of GLM-Image

GLM-Image

👋 Join our WeChat and Discord community
📖 Check out GLM-Image's Technical Blog
📍 Use GLM-Image's API

show_case

Introduction

GLM-Image is an image generation model adopts a hybrid autoregressive + diffusion decoder architecture. In general image generation quality, GLM‑Image aligns with mainstream latent diffusion approaches, but it shows significant advantages in text-rendering and knowledge‑intensive generation scenarios. It performs especially well in tasks requiring precise semantic understanding and complex information expression, while maintaining strong capabilities in high‑fidelity and fine‑grained detail generation. In addition to text‑to‑image generation, GLM‑Image also supports a rich set of image‑to‑image tasks including image editing, style transfer, identity‑preserving generation, and multi‑subject consistency.

Model architecture: a hybrid autoregressive + diffusion decoder design.

architecture_1

  • Autoregressive generator: a 9B-parameter model initialized from GLM-4-9B-0414 , with an expanded vocabulary to incorporate visual tokens. The model first generates a compact encoding of approximately 256 tokens, then expands to 1K–4K tokens, corresponding to 1K–2K high-resolution image outputs.
  • Diffusion Decoder: a 7B-parameter decoder based on a single-stream DiT architecture for latent-space image decoding. It is equipped with a Glyph Encoder text module, significantly improving accurate text rendering within images.

architecture_2

Post-training with decoupled reinforcement learning: the model introduces a fine-grained, modular feedback strategy using the GRPO algorithm, substantially enhancing both semantic understanding and visual detail quality.

  • Autoregressive module: provides low-frequency feedback signals focused on aesthetics and semantic alignment, improving instruction following and artistic expressiveness.
  • Decoder module: delivers high-frequency feedback targeting detail fidelity and text accuracy, resulting in highly realistic textures as well as more precise text rendering.

GLM-Image supports both text-to-image and image-to-image generation within a single model.

  • Text-to-image: generates high-detail images from textual descriptions, with particularly strong performance in information-dense scenarios.
  • Image-to-image: supports a wide range of tasks, including image editing, style transfer, multi-subject consistency, and identity-preserving generation for people and objects.

You can find the full GLM-Image Model implementation in the transformers and diffusers libraries here.

Showcase
T2I with dense text and knowledge

show_case_t2i

I2I

show_case_i2i

Quick Start
transformers + diffusers Pipeline

Install transformers and diffusers from source:

pip install git+https://github.com/huggingface/transformers.git
pip install git+https://github.com/huggingface/diffusers.git
  • Text to Image Generation
import torch
from diffusers.pipelines.glm_image import GlmImagePipeline

pipe = GlmImagePipeline.from_pretrained("zai-org/GLM-Image", torch_dtype=torch.bfloat16, device_map="cuda")
prompt = "A beautifully designed modern food magazine style dessert recipe illustration, themed around a raspberry mousse cake. The overall layout is clean and bright, divided into four main areas: the top left features a bold black title 'Raspberry Mousse Cake Recipe Guide', with a soft-lit close-up photo of the finished cake on the right, showcasing a light pink cake adorned with fresh raspberries and mint leaves; the bottom left contains an ingredient list section, titled 'Ingredients' in a simple font, listing 'Flour 150g', 'Eggs 3', 'Sugar 120g', 'Raspberry puree 200g', 'Gelatin sheets 10g', 'Whipping cream 300ml', and 'Fresh raspberries', each accompanied by minimalist line icons (like a flour bag, eggs, sugar jar, etc.); the bottom right displays four equally sized step boxes, each containing high-definition macro photos and corresponding instructions, arranged from top to bottom as follows: Step 1 shows a whisk whipping white foam (with the instruction 'Whip egg whites to stiff peaks'), Step 2 shows a red-and-white mixture being folded with a spatula (with the instruction 'Gently fold in the puree and batter'), Step 3 shows pink liquid being poured into a round mold (with the instruction 'Pour into mold and chill for 4 hours'), Step 4 shows the finished cake decorated with raspberries and mint leaves (with the instruction 'Decorate with raspberries and mint'); a light brown information bar runs along the bottom edge, with icons on the left representing 'Preparation time: 30 minutes', 'Cooking time: 20 minutes', and 'Servings: 8'. The overall color scheme is dominated by creamy white and light pink, with a subtle paper texture in the background, featuring compact and orderly text and image layout with clear information hierarchy."
image = pipe(
    prompt=prompt,
    height=32 * 32,
    width=36 * 32,
    num_inference_steps=50,
    guidance_scale=1.5,
    generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]

image.save("output_t2i.png")
  • Image to Image Generation
import torch
from diffusers.pipelines.glm_image import GlmImagePipeline
from PIL import Image

pipe = GlmImagePipeline.from_pretrained("zai-org/GLM-Image", torch_dtype=torch.bfloat16, device_map="cuda")
image_path = "cond.jpg"
prompt = "Replace the background of the snow forest with an underground station featuring an automatic escalator."
image = Image.open(image_path).convert("RGB")
image = pipe(
    prompt=prompt,
    image=[image],  # can input multiple images for multi-image-to-image generation such as [image, image1]
    height=33 * 32, # Must set height even it is same as input image
    width=32 * 32, # Must set width even it is same as input image
    num_inference_steps=50,
    guidance_scale=1.5,
    generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]

image.save("output_i2i.png")
SGLang Pipeline

Install transformers and diffusers from source:

pip install "sglang[diffusion] @ git+https://github.com/sgl-project/sglang.git#subdirectory=python"
pip install git+https://github.com/huggingface/transformers.git
pip install git+https://github.com/huggingface/diffusers.git
  • Text to Image Generation
sglang serve --model-path zai-org/GLM-Image

curl http://localhost:30000/v1/images/generations \
  -H "Content-Type: application/json" \
  -d '{
    "model": "zai-org/GLM-Image",
    "prompt": "a beautiful girl with glasses.",
    "n": 1,
    "response_format": "b64_json",
    "size": "1024x1024"
  }' |  python3 -c "import sys, json, base64; open('output_t2i.png', 'wb').write(base64.b64decode(json.load(sys.stdin)['data'][0]['b64_json']))"
  • Image to Image Generation
sglang serve --model-path zai-org/GLM-Image

curl -s -X POST "http://localhost:30000/v1/images/edits" \
-F "model=zai-org/GLM-Image" \
-F "[email protected]" \
-F "prompt=Replace the background of the snow forest with an underground station featuring an automatic escalator." \
-F "response_format=b64_json"  | python3 -c "import sys, json, base64; open('output_i2i.png', 'wb').write(base64.b64decode(json.load(sys.stdin)['data'][0]['b64_json']))"
Note
  • We strongly recommend to use GLM-4.7 to enhance prompts for higher image quality, Please check our github script for more details.
  • The AR model used in GLM‑Image is configured with do_sample=True , a temperature of 0.9 , and a topp of 0.75 by default. A higher temperature results in more diverse and rich outputs, but it can also lead to a certain decrease in output stability.
  • The target image resolution must be divisible by 32. Otherwise, it will throw an error.
  • Because the inference optimizations for this architecture are currently limited, the runtime cost is still relatively high. It requires either a single GPU with more than 80GB of memory, or a multi-GPU setup.
  • vLLM-Omni and SGLang (with AR speedup) support is currently being integrated — stay tuned. For inference cost, you can check in our github.
Model Performance
Text Rendering
Model Open Source CVTG-2K LongText-Bench
Word Accuracy NED CLIPScore AVG EN ZH
Seedream 4.5 0.8990 0.9483 0.8069 0.988 0.989 0.987
Seedream 4.0 0.8451 0.9224 0.7975 0.924 0.921 0.926
Nano Banana 2.0 0.7788 0.8754 0.7372 0.965 0.981 0.949
GPT Image 1 [High] 0.8569 0.9478 0.7982 0.788 0.956 0.619
Qwen-Image 0.8288 0.9116 0.8017 0.945 0.943 0.946
Qwen-Image-2512 0.8604 0.9290 0.7819 0.961 0.956 0.965
Z-Image 0.8671 0.9367 0.7969 0.936 0.935 0.936
Z-Image-Turbo 0.8585 0.9281 0.8048 0.922 0.917 0.926
GLM-Image 0.9116 0.9557 0.7877 0.966 0.952 0.979
Text-to-Image
Model Open Source OneIG-Bench TIIF-Bench DPG-Bench
EN ZH short long
Seedream 4.5 0.576 0.551 90.49 88.52 88.63
Seedream 4.0 0.576 0.553 90.45 88.08 88.54
Nano Banana 2.0 0.578 0.567 91.00 88.26 87.16
GPT Image 1 [High] 0.533 0.474 89.15 88.29 85.15
DALL-E 3 - - 74.96 70.81 83.50
Qwen-Image 0.539 0.548 86.14 86.83 88.32
Qwen-Image-2512 0.530 0.515 83.24 84.93 87.20
Z-Image 0.546 0.535 80.20 83.01 88.14
Z-Image-Turbo 0.528 0.507 77.73 80.05 84.86
FLUX.1 [Dev] 0.434 - 71.09 71.78 83.52
SD3 Medium - - 67.46 66.09 84.08
SD XL 0.316 - 54.96 42.13 74.65
BAGEL 0.361 0.370 71.50 71.70 -
Janus-Pro 0.267 0.240 66.50 65.01 84.19
Show-o2 0.308 - 59.72 58.86 -
GLM-Image 0.528 0.511 81.01 81.02 84.78

Runs of zai-org GLM-Image on huggingface.co

9.5K
Total runs
0
24-hour runs
-765
3-day runs
-1.8K
7-day runs
-262
30-day runs

More Information About GLM-Image huggingface.co Model

More GLM-Image license Visit here:

https://choosealicense.com/licenses/mit

GLM-Image huggingface.co

GLM-Image huggingface.co is an AI model on huggingface.co that provides GLM-Image's model effect (), which can be used instantly with this zai-org GLM-Image model. huggingface.co supports a free trial of the GLM-Image model, and also provides paid use of the GLM-Image. Support call GLM-Image model through api, including Node.js, Python, http.

GLM-Image huggingface.co Url

https://huggingface.co/zai-org/GLM-Image

zai-org GLM-Image online free

GLM-Image huggingface.co is an online trial and call api platform, which integrates GLM-Image's modeling effects, including api services, and provides a free online trial of GLM-Image, you can try GLM-Image online for free by clicking the link below.

zai-org GLM-Image online free url in huggingface.co:

https://huggingface.co/zai-org/GLM-Image

GLM-Image install

GLM-Image is an open source model from GitHub that offers a free installation service, and any user can find GLM-Image on GitHub to install. At the same time, huggingface.co provides the effect of GLM-Image install, users can directly use GLM-Image installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

GLM-Image install url in huggingface.co:

https://huggingface.co/zai-org/GLM-Image

Url of GLM-Image

GLM-Image huggingface.co Url

Provider of GLM-Image huggingface.co

zai-org
ORGANIZATIONS

Other API from zai-org

huggingface.co

Total runs: 2.0M
Run Growth: 1.8M
Growth Rate: 100.00%
Updated:September 07 2026
huggingface.co

Total runs: 1.9M
Run Growth: -1.3M
Growth Rate: -67.33%
Updated:September 11 2026
huggingface.co

Total runs: 1.9M
Run Growth: -163.1K
Growth Rate: -8.78%
Updated:January 29 2026
huggingface.co

Total runs: 1.3M
Run Growth: -706.1K
Growth Rate: -53.41%
Updated:September 01 2026
huggingface.co

Total runs: 982.0K
Run Growth: -1.8M
Growth Rate: -185.69%
Updated:September 01 2026
huggingface.co

Total runs: 745.7K
Run Growth: 703.7K
Growth Rate: 98.76%
Updated:September 04 2026
huggingface.co

Total runs: 445.4K
Run Growth: -19.6K
Growth Rate: -4.41%
Updated:August 04 2024
huggingface.co

Total runs: 227.0K
Run Growth: -238.4K
Growth Rate: -100.00%
Updated:April 16 2026
huggingface.co

Total runs: 158.6K
Run Growth: -861.0K
Growth Rate: -490.91%
Updated:April 05 2026
huggingface.co

Total runs: 100.1K
Run Growth: -150.2K
Growth Rate: -152.55%
Updated:August 11 2025
huggingface.co

Total runs: 93.0K
Run Growth: 19.3K
Growth Rate: 21.31%
Updated:January 29 2026
huggingface.co

Total runs: 90.1K
Run Growth: 13.0K
Growth Rate: 14.12%
Updated:May 13 2026
huggingface.co

Total runs: 89.9K
Run Growth: -1.8K
Growth Rate: -2.02%
Updated:March 13 2025
huggingface.co

Total runs: 85.5K
Run Growth: -39.5K
Growth Rate: -47.86%
Updated:August 11 2025
huggingface.co

Total runs: 76.9K
Run Growth: -75.2K
Growth Rate: -97.75%
Updated:December 10 2025
huggingface.co

Total runs: 63.6K
Run Growth: -20.9K
Growth Rate: -32.83%
Updated:December 05 2024
huggingface.co

Total runs: 56.9K
Run Growth: -67.8K
Growth Rate: -119.27%
Updated:August 11 2026
huggingface.co

Total runs: 45.1K
Run Growth: -76.9K
Growth Rate: -171.70%
Updated:October 25 2025
huggingface.co

Total runs: 22.2K
Run Growth: 4.5K
Growth Rate: 20.09%
Updated:November 23 2024
huggingface.co

Total runs: 20.6K
Run Growth: -58.0K
Growth Rate: -283.77%
Updated:March 03 2025
huggingface.co

Total runs: 20.2K
Run Growth: -20.2K
Growth Rate: -100.38%
Updated:April 14 2025
huggingface.co

Total runs: 18.6K
Run Growth: -9.8K
Growth Rate: -53.85%
Updated:September 30 2025
huggingface.co

Total runs: 15.9K
Run Growth: -2.4K
Growth Rate: -14.78%
Updated:November 23 2024
huggingface.co

Total runs: 14.9K
Run Growth: 13.7K
Growth Rate: 96.61%
Updated:September 04 2026
huggingface.co

Total runs: 13.7K
Run Growth: -14.3K
Growth Rate: -104.10%
Updated:December 23 2025
huggingface.co

Total runs: 13.0K
Run Growth: 2.5K
Growth Rate: 18.69%
Updated:December 09 2025
huggingface.co

Total runs: 8.1K
Run Growth: -1.7K
Growth Rate: -21.55%
Updated:October 16 2025
huggingface.co

Total runs: 7.0K
Run Growth: -6.9K
Growth Rate: -98.09%
Updated:April 22 2025
huggingface.co

Total runs: 7.0K
Run Growth: -1.7K
Growth Rate: -25.05%
Updated:March 11 2025
huggingface.co

Total runs: 5.3K
Run Growth: -2.2K
Growth Rate: -41.08%
Updated:January 27 2025
huggingface.co

Total runs: 4.4K
Run Growth: -4.5K
Growth Rate: -103.31%
Updated:December 09 2025
huggingface.co

Total runs: 3.1K
Run Growth: -1.4K
Growth Rate: -46.90%
Updated:October 25 2025
huggingface.co

Total runs: 3.0K
Run Growth: 999
Growth Rate: 32.98%
Updated:August 04 2024
huggingface.co

Total runs: 1.8K
Run Growth: 901
Growth Rate: 50.03%
Updated:August 12 2025
huggingface.co

Total runs: 675
Run Growth: 281
Growth Rate: 41.45%
Updated:March 02 2023
huggingface.co

Total runs: 464
Run Growth: -67
Growth Rate: -11.63%
Updated:August 11 2025
huggingface.co

Total runs: 440
Run Growth: -1.1K
Growth Rate: -261.28%
Updated:January 02 2025
huggingface.co

Total runs: 429
Run Growth: 250
Growth Rate: 58.55%
Updated:October 20 2023
huggingface.co

Total runs: 383
Run Growth: 123
Growth Rate: 32.11%
Updated:December 10 2024
huggingface.co

Total runs: 344
Run Growth: -398
Growth Rate: -122.09%
Updated:October 25 2025
huggingface.co

Total runs: 295
Run Growth: 127
Growth Rate: 42.76%
Updated:March 02 2023
huggingface.co

Total runs: 279
Run Growth: 69
Growth Rate: 24.73%
Updated:November 20 2023
huggingface.co

Total runs: 262
Run Growth: 116
Growth Rate: 44.11%
Updated:October 20 2023
huggingface.co

Total runs: 251
Run Growth: 105
Growth Rate: 42.17%
Updated:October 20 2023