Unconditional Image Generation
Diffusers
Safetensors
English
bitdance
imagenet
class-conditional
custom-pipeline
Instructions to use BiliSakura/BitDance-ImageNet-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BiliSakura/BitDance-ImageNet-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("BiliSakura/BitDance-ImageNet-diffusers", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| license: apache-2.0 | |
| library_name: diffusers | |
| pipeline_tag: unconditional-image-generation | |
| base_model: shallowdream204/BitDance-ImageNet | |
| language: | |
| - en | |
| tags: | |
| - bitdance | |
| - imagenet | |
| - class-conditional | |
| - custom-pipeline | |
| - diffusers | |
| # BitDance-ImageNet (Diffusers) | |
| Diffusers-compatible BitDance ImageNet checkpoints for class-conditional generation at `256x256`. | |
| ## Available Subfolders | |
| - `BitDance_B_1x` (`parallel_num=1`) | |
| - `BitDance_B_4x` (`parallel_num=4`) | |
| - `BitDance_B_16x` (`parallel_num=16`) | |
| - `BitDance_L_1x` (`parallel_num=1`) | |
| - `BitDance_H_1x` (`parallel_num=1`) | |
| All variants include a custom `BitDanceImageNetPipeline` and support ImageNet class IDs (`0-999`). | |
| ## Requirements | |
| - `flash-attn` is required for model execution and sampling. | |
| - Install it in your environment before loading the pipeline. | |
| ## Quickstart (native diffusers) | |
| ```python | |
| import torch | |
| from diffusers import DiffusionPipeline | |
| repo_id = "BiliSakura/BitDance-ImageNet-diffusers" | |
| subfolder = "BitDance_B_1x" # or BitDance_B_4x, BitDance_B_16x, BitDance_L_1x, BitDance_H_1x | |
| pipe = DiffusionPipeline.from_pretrained( | |
| repo_id, | |
| subfolder=subfolder, | |
| trust_remote_code=True, | |
| torch_dtype=torch.float16, | |
| ).to("cuda") | |
| # ImageNet class 207 = golden retriever | |
| out = pipe( | |
| class_labels=207, | |
| num_images_per_label=1, | |
| sample_steps=100, | |
| cfg_scale=4.6, | |
| ) | |
| out.images[0].save("bitdance_imagenet.png") | |
| ``` | |
| ## Local Path Note | |
| When loading from a local clone, do not point `from_pretrained` to the repo root unless you also provide `subfolder=...`. | |
| Each variant folder contains its own `model_index.json`, so the most reliable local usage is to load the variant directory directly: | |
| ```python | |
| from diffusers import DiffusionPipeline | |
| pipe = DiffusionPipeline.from_pretrained( | |
| "/path/to/BitDance-ImageNet-diffusers/BitDance_B_1x", | |
| trust_remote_code=True, | |
| ) | |
| ``` | |
| ## Model Metadata | |
| - Pipeline class: `BitDanceImageNetPipeline` | |
| - Diffusers version in configs: `0.36.0` | |
| - Resolution: `256x256` | |
| - Number of classes: `1000` | |
| - Autoencoder class: `BitDanceImageNetAutoencoder` | |
| ## Citation | |
| If you use this model, please cite BitDance and Diffusers: | |
| ```bibtex | |
| @article{ai2026bitdance, | |
| title = {BitDance: Scaling Autoregressive Generative Models with Binary Tokens}, | |
| author = {Ai, Yuang and Han, Jiaming and Zhuang, Shaobin and Hu, Xuefeng and Yang, Ziyan and Yang, Zhenheng and Huang, Huaibo and Yue, Xiangyu and Chen, Hao}, | |
| journal = {arXiv preprint arXiv:2602.14041}, | |
| year = {2026} | |
| } | |
| @inproceedings{von-platen-etal-2022-diffusers, | |
| title = {Diffusers: State-of-the-art diffusion models}, | |
| author = {Patrick von Platen and Suraj Patil and Anton Lozhkov and Damar Jablonski and Hernan Bischof and Thomas Wolf}, | |
| booktitle = {GitHub repository}, | |
| year = {2022}, | |
| url = {https://github.com/huggingface/diffusers} | |
| } | |
| ``` | |
| ## License | |
| This repository is distributed under the Apache-2.0 license, consistent with the upstream BitDance release. | |