/ Модель

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

Контекст
16 384 токена
Параметры
7,6 млрд
Размер весов
19,3 ГБ
Лицензия
MIT
Архитектура
omni · dense
Библиотека
transformers
Опубликована
30 окт 2026

G-star

Генерация текстаТекст → текст3 профессии

G-star — модель на базе Qwen3-8B для генерации изображений по текстовым описаниям с парными визуальным токенизатором и рефайнером.

271скачиваний за 30 дней6лайковвеса обновлены24 ноя 2026

Бенчмарки

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

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

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

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

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

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

G-star — модель генерации изображений по текстовому описанию, разработанная DAGroup-PKU. В основе лежит плотная OmniForCausalLM на базе Qwen3-8B с 7,6 млрд параметров, мостом визуальных эмбеддингов и головой DSpark. Модель формирует сетку визуальных кодов, которую парный визуальный токенизатор и рефайнер преобразуют в изображение: из сетки 32 × 32 получается изображение с исходным разрешением 2048 × 2048. Контекст модели — 16 384 токена.

Репозиторий также содержит отдельную SFT-модель gstar-edit для редактирования изображений по инструкции, соответствующий визуальный токенизатор и рефайнер. Для генерации и редактирования предусмотрен локальный запуск; проверенная конфигурация использует GPU NVIDIA H100 с 80 ГБ памяти. README отмечает, что мелкие детали могут содержать ошибки, а одинаковый seed не гарантирует идентичные результаты на разном оборудовании. Лицензия — MIT.

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

  • создание изображений 2048 × 2048 по текстовому описанию
  • генерация иллюстраций по пользовательскому промпту
  • редактирование изображения по текстовой инструкции с компонентом gstar-edit

Ограничения

Мелкие детали сгенерированных изображений могут содержать ошибки. Одинаковые seed не гарантируют идентичный результат на разном оборудовании; проверенная конфигурация требует GPU NVIDIA H100 с 80 ГБ памяти на рабочий процесс.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

G-star

This repository contains the G-star text-to-image generation model, the instruction-based image editing SFT model (gstar-edit/), the matching visual tokenizer, the visual refiner, and the inference code. Download the full repository, install the dependencies, and run inference locally. No training dataset or internal job platform is required.

Components

LocationComponent
Repository rootQwen3-8B generation backbone, visual embedding bridge and DSpark image head
gstar-edit/Qwen3-8B instruction-based image editing SFT model, visual embedding bridge and DSpark image head
tokenizer/Matching g16 visual tokenizer, with 16 codebooks of 16,384 entries and 32x downsampling
refiner/Matching g16 SR2x refiner, including its own visual encoder, codebooks, DiT and VAE
oneStep-SR2x_refiner/Matching g16 1-step SR2x refiner (1 DiT evaluation, faster drop-in alternative to refiner/)
gstar-flash-1.7b/G-STAR-Flash-1.7B (Qwen3-1.7B, 64x compression, 32-group DSpark SFT model)
gstar-flash-1.7b-refiner/Matching g8 reconstruction refiner paired with gstar-flash-1.7b/
gstar/G-star model implementation and generation pipeline
inference_config.jsonGeneration settings for this checkpoint
MANIFEST.jsonWeight-file SHA-256 checksums and component metadata

The standalone tokenizer is extracted from the tokenizer embedded in the paired refiner. Tensor values, dtypes and shapes are preserved, so both components share the same learned codebooks. Use this paired tokenizer and refiner with the generation checkpoint in this repository.

Download and install

The model was verified with Python 3.12, PyTorch 2.6.0 / CUDA 12.4, Transformers 4.57.0 and FlashAttention 2.7.4.post1 on NVIDIA H100 80 GB GPUs. Each inference worker uses one GPU.

python -m pip install 'huggingface_hub>=0.36,<1'
python - <<'PY'
from huggingface_hub import snapshot_download
snapshot_download(repo_id='DAGroup-PKU/G-star', local_dir='./G-star')
PY

cd G-star
python -m pip install --upgrade pip wheel packaging ninja
python -m pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0
python -m pip install --no-build-isolation -r requirements.txt \
  'flash-attn==2.7.4.post1' 'diffusers==0.38.0' 'accelerate==1.12.0'

Keep all downloaded configuration, text-tokenizer, Python implementation and weight-shard files. PyTorch and FlashAttention must match the machine's CUDA runtime and GPU.

Generate an image

Run from the downloaded G-star directory:

CUDA_VISIBLE_DEVICES=0 USE_TF=0 TOKENIZERS_PARALLELISM=false \
OMNI_DISABLE_WAVELET_COLOR_FIX=1 python -m gstar.infer \
  --task t2i --model . --visual-tokenizer ./refiner \
  --prompt-mode pretrain \
  --prompt 'A golden retriever lying on a wooden floor, looking up at its owner, warm morning sunlight, realistic photography.' \
  --height 1024 --width 1024 --cfg 2.4 \
  --top-k 4096 --top-p 0.75 --temperature 0.7 --seed 20260915 \
  --output outputs/generated_2048.png

This checkpoint uses the pretrain prompt format, without SFT role tokens. The LLM generates a 32 x 32 grid of g16 codes corresponding to a 1024 x 1024 image; the refiner produces a native 2048 x 2048 image. Its default refinement settings are 52 steps and seed 0. The command disables optional wavelet color correction to match the verified generation configuration.

For a 1024 output, resize with Lanczos:

python - <<'PY'
from PIL import Image
with Image.open('outputs/generated_2048.png') as image:
    image.resize((1024, 1024), Image.Resampling.LANCZOS).save('outputs/generated_1024.png')
PY

Prompts are used as supplied; pass rewritten text explicitly when using an external prompt-rewrite system. Fine details can contain generation errors, and identical seeds do not guarantee identical images across hardware.

Generate an image with G-STAR-Flash-1.7B (64x)

Use gstar-flash-1.7b/ together with its paired g8 reconstruction refiner gstar-flash-1.7b-refiner/ (g8 and g16 exports are incompatible):

CUDA_VISIBLE_DEVICES=0 USE_TF=0 TOKENIZERS_PARALLELISM=false \
python -m gstar.infer \
  --task t2i --model ./gstar-flash-1.7b --visual-tokenizer ./gstar-flash-1.7b-refiner \
  --prompt-mode sft \
  --prompt 'A golden retriever lying on a wooden floor, looking up at its owner, warm morning sunlight, realistic photography.' \
  --height 1024 --width 1024 --cfg 1.8 \
  --top-k 4096 --top-p 0.75 --temperature 0.7 --seed 20260915 \
  --output outputs/flash_1024.png

Edit an image

Prepare a 1024 x 1024 source image and run instruction-based editing from the downloaded G-star directory (see docs/installation-and-usage.md#edit-an-image):

python - <<'PY'
from PIL import Image, ImageOps
with Image.open('source.png') as image:
    ImageOps.fit(image.convert('RGB'), (1024, 1024),
                 method=Image.Resampling.LANCZOS).save('source_1024.png')
PY

CUDA_VISIBLE_DEVICES=0 USE_TF=0 TOKENIZERS_PARALLELISM=false \
python -m gstar.infer \
  --task edit --model ./gstar-edit --visual-tokenizer ./refiner \
  --image source_1024.png --prompt '将背景改为城市街道' \
  --height 1024 --width 1024 --cfg 1.8 --image-cfg 1.8 \
  --top-k 4096 --top-p 0.75 --temperature 0.7 --seed 20260908 \
  --output outputs/edited.png

gstar-edit/ includes role_config.json for SFT role tokens. --cfg controls text guidance and --image-cfg controls image guidance.

Load individual components

import torch
from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer

text_tokenizer = AutoTokenizer.from_pretrained('./G-star')
llm = AutoModelForCausalLM.from_pretrained(
    './G-star', trust_remote_code=True, torch_dtype=torch.bfloat16,
)
edit_llm = AutoModelForCausalLM.from_pretrained(
    './G-star/gstar-edit', trust_remote_code=True, torch_dtype=torch.bfloat16,
)
visual_tokenizer = AutoModel.from_pretrained(
    './G-star/tokenizer', trust_remote_code=True, torch_dtype=torch.bfloat16,
)
refiner = AutoModel.from_pretrained(
    './G-star/refiner', trust_remote_code=True, torch_dtype=torch.bfloat16,
)

For generation, use gstar.infer as shown above; it supplies the image-size prefixes, newline handling, CFG branches and DSpark sampling. Tokenizer encode/decode uses CUDA BF16 autocast. The unified refiner manages its own autocast internally.

Validation and licenses

The source generation configuration was verified on four rewritten benchmark prompts, with complete image-code grids and finite SR2x outputs. The public CLI was also run with real weights. Validation of the sanitized release is recorded in VALIDATION.json.

Operational paths, experiment names and training metadata are omitted from the release. Original trained model tensors and required serialization keys are preserved. Original G-star code is MIT-licensed; upstream source attributions and license headers are retained.

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

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

GPU в ailist

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

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
OmniForCausalLM
Ревизия весов
921bf8c

0 моделей