Instructions to use BiliSakura/GAT-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use BiliSakura/GAT-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("BiliSakura/GAT-diffusers", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
| 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 | |
| ``` | |