NiT Diffusers
Native diffusers implementation of NiT (Native-resolution Image Transformer). Each variant folder is self-contained:
Fonte do modelo
- Tipo
- Other
- Tamanho do arquivo
- 1,16 GB
- Versão
- vdiffusion_pytorch_model
- Atualizado
- 9 de out. de 2026
- Downloads
- 0
- Fonte
- Hugging Face
Descrição da fonte
NiT-diffusers
Native diffusers implementation of NiT (Native-resolution Image Transformer). Each variant folder is self-contained:
pipeline.py—NiTPipelinescheduler/scheduler_config.json—FlowMatchEulerDiscreteSchedulerconfig (class ships with Diffusers)transformer/nit_transformer_2d.py—NiTTransformer2DModelvae/—AutoencoderDCweights + config
No separate NiT-diffusers package at inference time; only PyPI diffusers plus local custom code in the variant directory.
Available checkpoints
| Checkpoint | Path | Resolution | Recommended settings |
|---|---|---|---|
| NiT-S | ./NiT-S | 256×256 | 250 steps, CFG 2.25, interval (0.0, 0.7) |
| NiT-B | ./NiT-B | 256×256 | 250 steps, CFG 2.25, interval (0.0, 0.7) |
| NiT-L | ./NiT-L | 512×512 | 250 steps, CFG 2.05, interval (0.0, 0.7) |
| NiT-XL | ./NiT-XL | 512×512 | 250 steps, CFG 2.05, interval (0.0, 0.7) |
ImageNet class labels
Each variant keeps an English id2label map directly in its own model_index.json (DiT-style).
pipe.id2label— inspect id → English label correspondencepipe.labels— reverse map (English synonym → id), sorted for browsingpipe.get_label_ids("golden retriever")pipe(class_labels="golden retriever", ...)— string labels resolved automatically
Inference
Run the bundled demo script from the repo root:
python demo_inference.py
This writes demo.png using NiT-XL with the settings below.
from pathlib import Path
import torch
from diffusers import DiffusionPipeline
model_dir = Path("./NiT-XL").resolve()
pipe = DiffusionPipeline.from_pretrained(
str(model_dir),
local_files_only=True,
custom_pipeline=str(model_dir / "pipeline.py"),
trust_remote_code=True,
torch_dtype=torch.bfloat16,
)
pipe.to("cuda")
print(pipe.id2label[207])
print(pipe.get_label_ids("golden retriever"))
generator = torch.Generator(device="cuda").manual_seed(42)
image = pipe(
class_labels="golden retriever",
height=512,
width=512,
num_inference_steps=250,
guidance_scale=2.05,
guidance_interval=(0.0, 0.7),
generator=generator,
).images[0]
image.save("demo.png")
Load a variant subfolder (e.g. ./NiT-XL, ./NiT-L, ./NiT-B, or ./NiT-S), not the repo root.
For NiT-S / NiT-B at 256×256 (official defaults):
model_dir = Path("./NiT-S").resolve() # or ./NiT-B
pipe = DiffusionPipeline.from_pretrained(
str(model_dir),
local_files_only=True,
custom_pipeline=str(model_dir / "pipeline.py"),
trust_remote_code=True,
torch_dtype=torch.bfloat16,
)
pipe.to("cuda")
image = pipe(
class_labels="golden retriever",
height=256,
width=256,
num_inference_steps=250,
guidance_scale=2.25,
guidance_interval=(0.0, 0.7),
generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]
Hub usage follows Hugging Face model-id style (UserID/RepoID):
from diffusers import DiffusionPipeline
import torch
pipe = DiffusionPipeline.from_pretrained(
"BiliSakura/NiT-diffusers",
subfolder="NiT-XL",
custom_pipeline="pipeline.py",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
)
pipe.to("cuda")
Citation
@article{wang2025native,
title={Native-Resolution Image Synthesis},
author={Wang, Zidong and Bai, Lei and Yue, Xiangyu and Ouyang, Wanli and Zhang, Yiyuan},
year={2025},
eprint={2506.03131},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Fontes
1 fonte
Fontes
1 fonteVerificado 9 de out.
Download files
Artefatos de modelo
4 artefatos
Artefatos de modelo
4 artefatosNiT-B/vae/diffusion_pytorch_model.safetensors
safetensors · 1,16 GB · SHA-256 dfd991d1b54f…54bb · Hugging Face
Download fileNiT-L/vae/diffusion_pytorch_model.safetensors
safetensors · 1,16 GB · SHA-256 dfd991d1b54f…54bb · Hugging Face
Download fileNiT-S/vae/diffusion_pytorch_model.safetensors
safetensors · 1,16 GB · SHA-256 dfd991d1b54f…54bb · Hugging Face
Download fileNiT-XL/vae/diffusion_pytorch_model.safetensors
safetensors · 1,16 GB · SHA-256 dfd991d1b54f…54bb · Hugging Face
Download fileTrechos de fonte
3 trechos
Trechos de fonte
3 trechos--- license: apache-2.0 language: - en library_name: diffusers tags: - diffusers - image-generation - class-conditional - nit pipeline_tag: unconditional-image-generation widget: - output: url: demo.png --- # NiT-diffusers Native diffusers implementation of **NiT** (Native-resolution Image Transformer). Each variant folder is self-contained: - `pipeline.py` — `NiTPipeline` - `scheduler/scheduler_config.json` — `FlowMatchEulerDiscreteScheduler` config (class ships with Diffusers) - `transformer/nit_transformer_2d.py` — `NiTTransformer2DModel` - `vae/` — `AutoencoderDC` weights + config No separate `NiT-diffusers` package at inference time; only PyPI `diffusers` plus local custom code in the variant directory. ## Available checkpoints | Checkpoint | Path | Resolution | Recommended settings | | --- | --- | --- | --- | | NiT-S | `./NiT-S` | 256×256 | 250 steps, CFG 2.25, interval (0.0, 0.7) | | NiT-B | `./NiT-B` | 256×256 | 250 steps, CFG 2.25, interval (0.0, 0.7) | | NiT-L | `./NiT-L` | 512×512 | 250 steps, CFG 2.05, interval (0.0, 0.7) | | NiT-XL | `./NiT-XL` | 512×512 | 250 steps, CFG 2.05, interval (0.0, 0.7) | ## ImageNet class labels Each variant keeps an English `id2label` map directly in its own `model_index.json` (DiT-style). - `pipe.id2label` — inspect id → English label correspondence - `pipe.labels` — reverse map (English synonym → id), sorted for browsing - `pipe.get_label_ids("golden retriever")` - `pipe(class_labels="golden retriever", ...)` — string labels resolved automatically ## Inference Run the bundled demo script from the repo root: ```bash python demo_inference.py ``` This writes `demo.png` using `NiT-XL` with the settings below. ```python from pathlib import Path import torch from diffusers import DiffusionPipeline model_dir = Path("./NiT-XL").resolve() pipe = DiffusionPipeline.from_pretrained( str(model_dir), local_files_only=True, custom_pipeline=str(model_dir / "pipeline.py"), trust_remote_code=True, torch_dtype=torch.bfloat16, ) pipe.to("cuda") print(pipe.id2label[207]) print(pipe.get_label_ids("golden retriever")) generator = torch.Generator(device="cuda").manual_seed(42) image = pipe( class_labels="golden retriever", height=512, width=512, num_inference_steps=250, guidance_scale=2.05, guidance_interval=(0.0, 0.7), generator=generator, ).images[0] image.save("demo.png") ``` Load a **variant sub...
Source context: 0 downloads · 0 likes · Pipeline unconditional-image-generation · Library diffusers · Repo BiliSakura/NiT-diffusers
Source context: 4 downloads · 0 likes · Pipeline unconditional-image-generation · Library diffusers · Repo BiliSakura/NiT-diffusers
