Skip to content
Other

DiT-Reward-Qwen-Image

оценка качества картинок по промпту

2 min readupdated

Модель оценивает, насколько сгенерированное изображение соответствует текстовому описанию и визуальным предпочтениям, выдавая на выходе одно число (скалярный скор). Это не генератор картинок, а reward-модель (модель вознаграждения) для автоматической проверки и ранжирования результатов. Построена на базе Qwen/Qwen-Image размером 28.87B параметров и выпущена анонимными авторами для научной публикации (Submission 7366). В отличие от самой базы, она извлекает признаки из внутренних блоков трансформера и прогоняет их через специальную голову оценки. Пригодится разработчикам, которые фильтруют датасеты, отбирают лучшие генерации или настраивают RLHF (обучение с подкреплением на основе предпочтений).

Ключевые особенности

  • Полностью автономный релиз: в репозиторий включены все веса трансформера, VAE, текстового энкодера Qwen и токенизатора — докачивать базовую модель не нужно.
  • Работает с внутренними признаками: извлекает фичи из блоков [29, 39, 49, 59] с коэффициентом шума flow-matching 0.005 и пропускает через MLP (1536 → 384 → 1).
  • Веса получены линейным слиянием (linear_parameter_interpolation_fp32_3way) трёх чекпоинтов с шагов 13400, 14000 и 13800 в пропорции 0.5 / 0.4 / 0.1.
  • Встроена проверка целостности: скрипт отклоняет битые чекпоинты и поддерживает сверку SHA-256 хэшей через флаг --verify-hashes.

Что можно сделать

  • Автоматически отбирать лучшие варианты при пакетной генерации изображений под заданный промпт.
  • Фильтровать и размечать большие парные датасеты «картинка — текст» через встроенный CLI-режим с поддержкой --input-jsonl.
  • Использовать как функцию вознаграждения при дообучении собственных генеративных моделей.

Пример

import torch
from inference import DiTReward
torch.manual_seed(0)
model = DiTReward(".", device="cuda")
scores = model.score(["example.png"], ["A red bicycle next to a tree."], batch_size=1)
print(scores)
ПодробнееРазмер модели: 28.87B параметров, требуется CUDA-совместимый PyTorch (рекомендуется начинать с batch_size=1).
Входное изображение приводится к размеру 512×512 (ресайз по меньшей стороне и центральный кроп), обязательно требуется текстовый промпт.
Скор калиброван только внутри самой модели — напрямую сравнивать его с цифрами других reward-моделей нельзя.
Лицензия весов: Apache-2.0 (на базе Qwen), код распространяется под MIT.
Discuss Telegram 0 17

Will it run?

Runs in 4-bit

Full precision does not fit, a quantised version does: quality barely changes down to 8 bits, more noticeably at 4 bits.

  • BF16weights 54 GB · ready files60 GB
  • FP8 / INT8recommendedweights 27 GB30 GB
  • 4-bitweights 15 GB17 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # iclr2027-7366/DiT-Reward-Qwen-Image
    # ===== Tokens: paste yours between the quotes =====
    export HF_TOKEN=""        # huggingface.co/settings/tokens, for gated models
    # ==========================================
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download iclr2027-7366/DiT-Reward-Qwen-Image --local-dir ~/models/DiT-Reward-Qwen-Image
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to DiT-Reward-Qwen-Image
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of Qwen-Image (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 12All on Hugging Face
Fine-tunes 12All on Hugging Face
LoRAs and adapters 12All on Hugging Face

About the model

iclr2027-7366/DiT-Reward-Qwen-Image
Author
iclr2027-7366
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

170

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments