/ Модель

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

Лицензия
Apache 2.0
Опубликована
24 ноя 2026

nyx-image-36m

Генерация изображенийТекст → изображение
133скачиваний за 30 дней7лайковвеса обновлены28 ноя 2026

Описание модели

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

Nyx Image 36M — компактная модель Bhoid и Sednium Technologies для генерации 32×32 RGBA-пиксельных спрайтов по текстовым запросам.

Nyx Image 36M (Nyx-2) — модель генерации пиксельной графики, разработанная Bhoid в Sednium Technologies и распространяемая с открытыми весами по лицензии Apache-2.0. Она создаёт спрайты для игр размером 32×32 пикселя по текстовым запросам; карточка демонстрирует результаты на примерах объектов, включая рождественскую ёлку.

Модель использует архитектуру NyxRGBAHourglassDiT — трансформер с потоком Rectified Flow и многошкальным U-ViT-бэкбоном. Она моделирует четыре канала RGBA непосредственно в пространстве пикселей, без латентного автоэнкодера и таблиц палитр. Заявленное число параметров — около 36 млн; для текстового внимания используются замороженные токены SigLIP. Репозиторий содержит форматы ONNX и safetensors.

Специализация на малых спрайтах и бинарной прозрачности помогает получать чёткие контуры и маски альфа-канала для игровых ассетов. Модель рассчитана на английские текстовые запросы и разрешение 32×32; сведений о генерации изображений в других разрешениях в карточке нет.

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

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

Ограничения

Модель предназначена для изображений размером 32×32 пикселя и ориентирована на английские запросы. Карточка не подтверждает качество генерации в других стилях или разрешениях.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

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

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

Открыть на Hugging Face

Nyx-2 36M Generated Showcase Figure 1: Widescreen showcase of 36 distinct 32×32 pixel art sprites synthesized exclusively by our frontier checkpoint (Step 90,000 / Final EMA) using second-order Heun ODE integration (30 steps, CFG scale 4.0). Rendered at 4× nearest-neighbor integer scaling with strict binary alpha transparency.

Nyx-2 36M Training Progression Figure 2: Training convergence across milestone checkpoints (Epoch 25, 50, 75, 100, 133, and final EMA) for prompt "a christmas tree" (seed 42, 30 Heun steps, CFG 4.0). Initial color massing at Epoch 25 resolves into defined foliage tiers at Epoch 50, distinct ornaments at Epoch 100, and balanced pixel shading at Epoch 133.


Overview

Nyx Image 36M (NyxRGBAHourglassDiT) is an open-weights continuous Rectified Flow transformer engineered to synthesize native 32×32 RGBA game sprites directly from text prompts.

By bypassing continuous latent autoencoders (VAEs) and discrete palette lookup tables, Nyx-2 models four continuous channels ($R, G, B, A \in [-1.0, 1.0]$) directly in pixel space. This design preserves sharp pixel boundaries, eliminates palette quantization banding, and guarantees clean binary transparency masks.


Technical Specifications

SpecificationValueNotes
ArchitectureNyxRGBAHourglassDiT2+8+2 U-ViT with pixel stem & multi-scale skip fusions
Trainable Parameters35,989,840 (35.99M)Exact parameter count verified via state dictionary
Native Canvas Resolution32×32 pixels (1,024 pixels)4 channels: Red, Green, Blue, Alpha
Color DomainContinuous 4-Channel RGBAFloat values in $[-1.0, 1.0]$ mapped to $[0, 255]$ uint8
Diffusion FormulationContinuous Rectified Flow (RF)Velocity vector field regression $v = \epsilon - x_0$
Sampling AlgorithmSecond-Order Heun ODE Solver30 steps with Euler endpoint at $t = 0.0$
Guidance DynamicsClassifier-Free Guidance (CFG)Scale 4.0 applied on $t \in [0.0, 0.75]$, disabled near $t = 0.0$
Text ConditioningSigLIP Base Patch16-224768-dim pooled sentence vector + 32-token sequence
Prompt Template"pixel art icon of a <prompt>"Prepended to match training caption distribution
Transparency ContractBinary Alpha Boundary$A = +1.0$ opaque; $A = -1.0$ transparent ($RGB = 0.0$)
Training Datasetazyg0s/pixelart-172k172,000 curated 32×32 RGBA pixel art icons
Training Steps90,000 steps (~133.7 epochs)Warmup-Stable-Decay (WSD) schedule with 15% cooldown
Validation Loss0.08327 MSEUnseen subject test split: 0.10225 MSE
Safetensors Size137.3 MBSingle-file weight distribution
ONNX Graph Size140.1 MBStandalone graph (opset 18) for WebGPU and edge runtimes
FP16 Weights68.7 MBHalf-precision PyTorch weights

Architectural Deep Dive

Hourglass U-ViT Backbone

Nyx-2 uses an asymmetrical multi-scale U-ViT architecture designed for dense $32 \times 32$ spatial layout:

Input [B, 4, 32, 32]
  │
  ├──> Pixel Stem (32×32, 64 channels, 2 residual blocks) ──> Skip 32×32
  │      │
  │      └──> Stride-2 Conv (16×16, 256 channels)
  │             │
  │             ├──> Outer Encoder (16×16, 2 blocks, SwiGLU, 2D-RoPE) ──> Skip 16×16
  │             │      │
  │             │      └──> Stride-2 Conv (8×8, 384 channels)
  │             │             │
  │             │             └──> Bottleneck (8×8, 8 blocks, SwiGLU, cross-attention)
  │             │             │
  │             │      ┌──────┘
  │             │      ▼
  │             └──> Upsample + Outer Decoder (16×16, 2 blocks) <── Skip 16×16
  │                    │
  │      ┌─────────────┘
  │      ▼
  └──> Upsample + Output Head (32×32, 64 channels) <── Skip 32×32
         │
         └──> 3×3 Conv Velocity Head ──> Output v_pred [B, 4, 32, 32]
  1. Pixel-Exact Stem: Two convolutional residual blocks operating at native 32×32 resolution project raw RGBA inputs into 64 feature channels.
  2. 2D Rotary Position Embeddings (2D-RoPE): Both outer encoder/decoder stages ($16 \times 16$) and bottleneck stages ($8 \times 8$) use 2D spatial rotary embeddings. Head dimensions are split between vertical and horizontal spatial frequencies, preserving pixel grid coordinates without absolute position degradation.
  3. Multi-Scale Skip Connections: Feature maps from the pixel stem ($32 \times 32$) and outer encoder ($16 \times 16$) are concatenated and fused via $1 \times 1$ convolutions into the decoder, anchoring high-frequency outline detail.
  4. Conv-SwiGLU Bottleneck: Eight transformer blocks at the $8 \times 8$ latent grid combine cross-attention over frozen SigLIP text tokens with depthwise convolutional SwiGLU feed-forward networks.

Transparency Contract

Sprites follow a binary transparency protocol:

  • Transparent Background: $A = -1.0$ and $RGB = (0.0, 0.0, 0.0)$.
  • Opaque Foreground: $A = +1.0$ and $RGB \in [-1.0, 1.0]$.
  • Inference Threshold: During sampling, pixels with $A < 0.0$ are clamped to zero alpha and zero RGB:

$$\text{Alpha}(x) = \begin{cases} 255 & \text{if } A \ge 0.0 \ 0 & \text{if } A < 0.0 \end{cases}$$

This eliminates color fringing, halos, and semi-transparent blur around sprite contours.

Second-Order Heun ODE Sampler

Sampling integrates the continuous velocity trajectory from standard Gaussian noise ($t = 1.0$) to clean image ($t = 0.0$) using 30 integration steps:

  1. Predictor Step: $$x_{\text{pred}} = x_t + \Delta t \cdot v(x_t, t)$$
  2. Corrector Step: $$x_{t + \Delta t} = x_t + \frac{\Delta t}{2} \cdot \left[ v(x_t, t) + v(x_{\text{pred}}, t + \Delta t) \right]$$
  3. Euler Endpoint: The final step to $t = 0.0$ uses a direct Euler update to prevent evaluation at the singular boundary.
  4. CFG Schedule: Classifier-Free Guidance (scale 4.0) is active for $t \in [0.0, 0.75]$ and disabled near $t = 0.0$, preventing over-saturation and preserving subtle color gradations.

Checkpoints and Model Files

All model weights are verified, self-contained, and released under Apache-2.0:

File NameFormatSizeDescription
nyx-image-36m.safetensorsSafetensors137.3 MBNative 32×32 RGBA weights for PyTorch and web runtimes
nyx-image-36m.onnxONNX (Opset 18)140.1 MBStandalone graph, tested in ONNX Runtime & WebGPU
nyx-image-36m-fp16.ptPyTorch Checkpoint68.7 MBHalf-precision EMA weights for inference
config.jsonJSON972 BModel hyperparameters, training config, and benchmarks
metrics_90000.jsonJSON213 BFinal evaluation metrics across test splits
icon.pngPNG2.4 KBOfficial 256×256 Christmas tree sprite icon
showcase_36m.pngPNG41.3 KB36-sprite widescreen showcase banner
progression_christmas_tree.pngPNG19.8 KB5-way checkpoint training progression

Quickstart

Installation

pip install torch torchvision transformers pillow numpy safetensors onnxruntime sentencepiece

Python Inference (PyTorch & Safetensors)

import torch
from PIL import Image
from safetensors.torch import load_file

from nyx_v2.model import NyxRGBAHourglassDiT
from nyx_v2.sampler import sample_sprites, to_rgba_u8
from nyx_v2.text import SiglipTextEncoder, encode_empty_prompt, wrap_prompt

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

# 1. Load model weights
model = NyxRGBAHourglassDiT().to(device)
state = load_file("nyx-image-36m.safetensors")
model.load_state_dict(state)
model.eval()

# 2. Encode text conditioning
encoder = SiglipTextEncoder(device=str(device))
prompt = "a christmas tree"
features = encoder.encode([wrap_prompt(prompt)])
uncond = encode_empty_prompt(encoder)

# 3. Sample 32x32 RGBA sprite (30 Heun ODE steps, CFG 4.0)
with torch.no_grad():
    samples = sample_sprites(
        model,
        features.pool.to(device),
        features.tokens.to(device),
        features.mask.to(device),
        uncond_pool=uncond.pool.to(device),
        uncond_tokens=uncond.tokens.to(device),
        uncond_mask=uncond.mask.to(device),
        steps=30,
        cfg=4.0,
        generator=torch.Generator(device=device).manual_seed(42),
    )

# 4. Save PNG with nearest-neighbor integer scaling
rgba_u8 = to_rgba_u8(samples.float())[0]
image = Image.fromarray(rgba_u8, mode="RGBA")
image.resize((256, 256), Image.Resampling.NEAREST).save("christmas_tree.png")
print("Saved christmas_tree.png (32x32 native, upscaled 8x)")

ONNX Runtime Inference

import numpy as np
import onnxruntime as ort

session = ort.InferenceSession("nyx-image-36m.onnx", providers=["CPUExecutionProvider"])

# Expected ONNX inputs:
# - x: [B, 4, 32, 32] float32
# - t: [B] float32
# - text_pool: [B, 768] float32
# - text_tokens: [B, 32, 768] float32
# - text_mask: [B, 32] bool

batch_size = 1
feeds = {
    "x": np.random.randn(batch_size, 4, 32, 32).astype(np.float32),
    "t": np.array([0.5], dtype=np.float32),
    "text_pool": np.zeros((batch_size, 768), dtype=np.float32),
    "text_tokens": np.zeros((batch_size, 32, 768), dtype=np.float32),
    "text_mask": np.ones((batch_size, 32), dtype=bool),
}

outputs = session.run(["v_pred"], feeds)
v_pred = outputs[0]  # Shape: (1, 4, 32, 32)
print("ONNX forward pass successful. Output shape:", v_pred.shape)

Validation Metrics (Step 90,000 / Epoch 133.7)

Evaluated on fixed validation splits from azyg0s/pixelart-172k:

  • Overall Flow Validation Loss: 0.08327 MSE
  • Patterns Split: 0.09378 MSE
  • R6 Split: 0.10055 MSE
  • Color Binding Split: 0.08060 MSE
  • Unseen Subject Split: 0.10225 MSE

Training Hardware

Trained on a single-GPU AWS EC2 Spot instance (g6.2xlarge, NVIDIA L4 24GB GPU, Ada Lovelace architecture) running PyTorch 2.5 with bfloat16 mixed precision and FlashAttention-2. Persistent Amazon EBS volumes were attached for dataset cache, checkpoints, and validation artifacts to preserve state across spot interruptions.


License

Nyx Image 36M is licensed under the Apache-2.0 License.

Copyright 2026 Sednium Technologies

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

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

GPU в ailist

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

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

Не удалось определить, чем загружать веса модели (нет library_name и architectures).

Ревизия весов
3ac6af2

0 моделей