/ Модель

Характеристики

Лицензия
MIT
Библиотека
diffusers
Опубликована
1 авг 2026

GLM-Image

Генерация изображенийТекст → изображение

Производная модели zai-org/GLM-Image. GLM-Image — гибридная авторегрессионно-диффузионная модель для генерации и редактирования изображений по текстовым запросам и изображениям.

5скачиваний за 30 дней0лайковвеса обновлены1 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Изображения» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели сгенерируют результат по каждой задаче. Опубликованный тест появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Карточка модели rAVEUK/GLM-Image на Hugging Face совпадает с карточкой zai-org/GLM-Image, поэтому описание составлено по ней.

GLM-Image — модель генерации изображений от команды zai-org. Она сочетает авторегрессионный генератор на 9 млрд параметров, инициализированный из GLM-4-9B-0414, и диффузионный декодер на 7 млрд параметров на основе одно поточной архитектуры DiT. Модель принимает текстовые описания для генерации изображений, а также изображения для редактирования, переноса стиля, сохранения идентичности объектов и согласованности нескольких персонажей.

GLM-Image рассчитана на создание детализированных изображений и особенно хорошо справляется с точным отображением текста и генерацией, требующей предметных знаний и сложного семантического понимания. В карточке указана поддержка китайского и английского языков; для текста, который должен появиться на изображении, рекомендуется использовать кавычки в запросе. Модель распространяется под лицензией MIT. Ограничения: высокая стоимость инференса из-за ограниченных оптимизаций; целевое разрешение должно делиться на 32. Повышенная температура генерации увеличивает разнообразие, но может снижать стабильность результата.

Сценарии применения

  • генерация изображений с точной надписью по текстовому запросу
  • создание детализированных иллюстраций по сложному описанию
  • редактирование изображения по текстовой инструкции
  • перенос художественного стиля на изображение
  • создание изображений с сохранением внешности человека или объекта
  • генерация сцен с несколькими согласованными персонажами

Ограничения

Инференс ресурсоёмкий, а целевое разрешение должно делиться на 32. Повышение температуры увеличивает разнообразие генерации, но может снижать стабильность результата.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

GLM-Image

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.

  • 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.

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

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 "image=@cond.jpg" \
-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

  • Please ensure that all text intended to be rendered in the image is enclosed in quotation marks in the model input and We strongly recommend using 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 inference optimizations for this architecture are currently limited, the runtime cost is still relatively high. You can set enable_model_cpu_offload=True to run it with ~23GB of GPU memory, at the cost of slower inference.
  • 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

Text-to-Image

License

The overall GLM-Image model is released under the MIT License.

This project incorporates the VQ tokenizer weights and VIT weights from X-Omni/X-Omni-En, which are licensed under the Apache License, Version 2.0.

The VQ tokenizer and VIT weights remains subject to the original Apache-2.0 terms. Users should comply with the respective licenses when using this component.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · diffusers

Можно запустить

Подбираем GPU…

Ревизия весов
49d7106

0 моделей