Diffusers-style implementation of PixNerd (Pixel Neural Field Diffusion), following the layout of NiT-diffusers.
Legacy training stacks, spec-based model loaders, and bundled checkpoint pipelines have been removed. Inference uses native Diffusers components under src/diffusers.
src/diffusers/models/transformers/transformer_pixnerd.py — PixNerdTransformer2DModel and PixNerDiTsrc/diffusers/models/autoencoders/autoencoder_pixel.py — PixNerdPixelVAEsrc/diffusers/models/conditioners/conditioner_pixnerd.py — PixNerdLabelConditionersrc/diffusers/schedulers/scheduling_flow_match_pixnerd.py — PixNerdFlowMatchSchedulersrc/diffusers/pipelines/pixnerd/pipeline_pixnerd.py — PixNerdPipelinescripts/convert_pixnerd_ckpt_to_diffusers.py — convert raw .ckpt files to a Diffusers pipeline directoryscripts/sample_pixnerd.py — sample from a converted pipelinepip install -e .
Or install dependencies only:
pip install -r requirements.txt
python main.py sample \
--pretrained_model_name_or_path path/to/converted-checkpoint \
--class_label 207 \
--num_images_per_prompt 4 \
--output_dir samples
python scripts/sample_pixnerd.py \
--model path/to/converted-checkpoint \
--class-label 207 \
--height 512 \
--width 512 \
--num-inference-steps 25 \
--guidance-scale 4.0 \
--timeshift 3.0 \
--order 2
python scripts/convert_pixnerd_ckpt_to_diffusers.py \
--checkpoint raw/imagenet256/epoch%3D319-step%3D1600000_emainit.ckpt \
--output models/BiliSakura/PixNerd-diffusers/PixNerd-XL-16-256
Batch conversion:
python scripts/convert_raw_imagenet_ckpts.py
Converted directories contain model_index.json, separate transformer/, scheduler/, vae/, and conditioner/ subfolders compatible with PixNerdPipeline.from_pretrained.
import sys
from pathlib import Path
sys.path.insert(0, str(Path("src").resolve()))
from diffusers import PixNerdPipeline
pipe = PixNerdPipeline.from_pretrained(
"models/BiliSakura/PixNerd-diffusers/PixNerd-XL-16-512",
torch_dtype=torch.bfloat16,
)
images = pipe(class_labels="golden retriever", num_inference_steps=25, guidance_scale=4.0).images
python app.py --pretrained_model_name_or_path path/to/converted-checkpoint
Copy the files under src/diffusers into the matching locations in the huggingface/diffusers repository and register the classes in Diffusers' lazy import tables.
@article{2507.23268,
Author = {Shuai Wang and Ziteng Gao and Chenhui Zhu and Weilin Huang and Limin Wang},
Title = {PixNerd: Pixel Neural Field Diffusion},
Year = {2025},
Eprint = {arXiv:2507.23268},
}
Python
100.0%
Diffusers-style implementation of PixNerd (Pixel Neural Field Diffusion), following the layout of NiT-diffusers.
Legacy training stacks, spec-based model loaders, and bundled checkpoint pipelines have been removed. Inference uses native Diffusers components under src/diffusers.
src/diffusers/models/transformers/transformer_pixnerd.py — PixNerdTransformer2DModel and PixNerDiTsrc/diffusers/models/autoencoders/autoencoder_pixel.py — PixNerdPixelVAEsrc/diffusers/models/conditioners/conditioner_pixnerd.py — PixNerdLabelConditionersrc/diffusers/schedulers/scheduling_flow_match_pixnerd.py — PixNerdFlowMatchSchedulersrc/diffusers/pipelines/pixnerd/pipeline_pixnerd.py — PixNerdPipelinescripts/convert_pixnerd_ckpt_to_diffusers.py — convert raw .ckpt files to a Diffusers pipeline directoryscripts/sample_pixnerd.py — sample from a converted pipelinepip install -e .
Or install dependencies only:
pip install -r requirements.txt
python main.py sample \
--pretrained_model_name_or_path path/to/converted-checkpoint \
--class_label 207 \
--num_images_per_prompt 4 \
--output_dir samples
python scripts/sample_pixnerd.py \
--model path/to/converted-checkpoint \
--class-label 207 \
--height 512 \
--width 512 \
--num-inference-steps 25 \
--guidance-scale 4.0 \
--timeshift 3.0 \
--order 2
python scripts/convert_pixnerd_ckpt_to_diffusers.py \
--checkpoint raw/imagenet256/epoch%3D319-step%3D1600000_emainit.ckpt \
--output models/BiliSakura/PixNerd-diffusers/PixNerd-XL-16-256
Batch conversion:
python scripts/convert_raw_imagenet_ckpts.py
Converted directories contain model_index.json, separate transformer/, scheduler/, vae/, and conditioner/ subfolders compatible with PixNerdPipeline.from_pretrained.
import sys
from pathlib import Path
sys.path.insert(0, str(Path("src").resolve()))
from diffusers import PixNerdPipeline
pipe = PixNerdPipeline.from_pretrained(
"models/BiliSakura/PixNerd-diffusers/PixNerd-XL-16-512",
torch_dtype=torch.bfloat16,
)
images = pipe(class_labels="golden retriever", num_inference_steps=25, guidance_scale=4.0).images
python app.py --pretrained_model_name_or_path path/to/converted-checkpoint
Copy the files under src/diffusers into the matching locations in the huggingface/diffusers repository and register the classes in Diffusers' lazy import tables.
@article{2507.23268,
Author = {Shuai Wang and Ziteng Gao and Chenhui Zhu and Weilin Huang and Limin Wang},
Title = {PixNerd: Pixel Neural Field Diffusion},
Year = {2025},
Eprint = {arXiv:2507.23268},
}
Python
100.0%