Instructions to use sayakpaul/torchtpu-sdxl-lora-sprint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use sayakpaul/torchtpu-sdxl-lora-sprint with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("sayakpaul/torchtpu-sdxl-lora-sprint") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
SDXL DreamBooth LoRAs from the TorchTPU sprint
Two independent runs fine-tuned the U-Net attention layers of SDXL Base 1.0 on the same five dog photos with Diffusers and TorchTPU. Both used rank 4, 100 AdamW updates, learning rate 0.0001, batch size 1, 512 × 512 center crops, seed 0, and the training prompt a photo of sks dog. Base model · Training images
| Trackio run | Adapter | Gradient checkpointing |
|---|---|---|
| GCP-v6e-1 | GCP weights | Off |
| Colab-v5e1 | Colab weights | On |
The matched previews used a photo of sks dog wearing a red scarf, seed 0, and 25 denoising steps. In Trackio, open Metrics for loss or Media & Tables for the before-and-after images. Public sprint dashboard
GPU inference verification
A Hugging Face Job loaded each TPU-trained adapter from the public weight release into SDXL on one NVIDIA A10G (CUDA 12.6). The base model and both adapters used the red-scarf prompt above, seed 0, 512 × 512 resolution, 25 denoising steps, and guidance scale 5.0. Removing the adapters reproduced the original base image pixel for pixel. HF Job
Both adapter files matched the hashes of the original training outputs. The report records the exact model revisions, package versions, image hashes, and pixel differences. Verification report
Verify the files
Download the sprint release and compare both files with the SHA-256 hashes of the original training outputs.
hf download sayakpaul/torchtpu-sdxl-lora-sprint --revision sprint-v1 --local-dir sprint-weights
(cd sprint-weights && shasum -a 256 -c SHA256SUMS)
Inference on CUDA
Choose the subfolder for the TPU run you want to load.
import torch
from diffusers import StableDiffusionXLPipeline
pipe = StableDiffusionXLPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", variant="fp16", torch_dtype=torch.float16
).to("cuda")
pipe.load_lora_weights(
"sayakpaul/torchtpu-sdxl-lora-sprint", revision="sprint-v1",
subfolder="colab-v5e1", # or "gcp-v6e-1"
weight_name="pytorch_lora_weights.safetensors",
)
image = pipe(
"a photo of sks dog wearing a red scarf", height=512, width=512,
num_inference_steps=25, guidance_scale=5.0, generator=torch.Generator().manual_seed(0),
).images[0]
image.save("dog.png")
- Downloads last month
- -
Model tree for sayakpaul/torchtpu-sdxl-lora-sprint
Base model
stabilityai/stable-diffusion-xl-base-1.0

