File size: 1,708 Bytes
2d67f83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
library_name: diffusers
pipeline_tag: image-to-image
tags:
- diffusers
- gat
- gan
- class-conditional
- imagenet
inference: true
widget:
- output:
    url: GAT-XL-2-256/demo.png
language:
- en
---

# BiliSakura/GAT-diffusers

Self-contained [Generative Adversarial Transformers (GAT)](https://arxiv.org/abs/2509.24935) checkpoints for Hugging Face diffusers.

Converted from the official GAT XL-2 checkpoint using `libs/GAT-diffusers/scripts/convert_gat_checkpoint.py`.

GAT performs one-step class-conditional image generation in Stable Diffusion VAE latent space (`sd-vae-ft-ema`).

## Demo

`GAT-XL-2-256` — class **207** (*golden retriever*), seed **0**, `truncation_psi=0.3`:

<p align="center">
  <img src="GAT-XL-2-256/demo.png" alt="GAT-XL-2-256 demo (class 207, seed 0)" width="256"/>
</p>

## Variants

| Model | Resolution | Params | Checkpoint |
| --- | --- | --- | --- |
| GAT-XL/2 | 256×256 | 675M | `GAT-XL-2-256/` |

## Usage

```python
from pathlib import Path
import torch
from diffusers import DiffusionPipeline

model_dir = Path("./GAT-XL-2-256").resolve()
pipe = DiffusionPipeline.from_pretrained(
    str(model_dir),
    custom_pipeline=str(model_dir / "pipeline.py"),
    trust_remote_code=True,
    torch_dtype=torch.float32,
    local_files_only=True,
).to("cuda")

image = pipe(
    class_labels="golden retriever",
    truncation_psi=0.3,
    generator=torch.Generator("cuda").manual_seed(0),
).images[0]
```

## Conversion

```bash
conda activate rsgen
python libs/GAT-diffusers/scripts/convert_gat_checkpoint.py \
  --ckpt models/BiliSakura/GAT-diffusers/gat-xl-2-256.pt \
  --output-dir models/BiliSakura/GAT-diffusers/GAT-XL-2-256 \
  --resolution 256
```