File size: 2,996 Bytes
46df95c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
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.