Downloads · 30 days
0
Alrightlone/OBS-Diff-SDXL
OBS-Diff-SDXL is a text-to-image model from Alrightlone. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as openrail++.
<div style=" display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; border: 1px solid e0e0e0; padding: 20px; border-radius: 10px; margin-bottom: 20px; background-color: fff; "
Downloads · 30 days
0
Access
Public
Updated Jan 2, 2026
Repo size
21.3 GB
Likes
1
Public
Click a slice to open those files.
.pth21.3 GB · 100%
From the Hugging Face model README
OBS-Diff-SDXL provides a collection of structured-pruned checkpoints for the Stable Diffusion XL (SDXL) base model, compressed using the OBS-Diff framework. By leveraging an efficient one-shot pruning algorithm, this model significantly reduces the parameter count of the UNet while maintaining high-fidelity image generation capabilities. The provided variants cover a sparsity range from 10% to 30%, offering a trade-off between model size and performance.

| Sparsity (%) | 0 (Dense) | 10 | 15 | 20 | 25 | 30 |
|---|---|---|---|---|---|---|
| Params (B) | 2.57 | 2.35 | 2.24 | 2.13 | 2.02 | 1.91 |
Download the base model (SDXL) from huggingface or ModelScope.
Download the pruned weights (.pth files) and use torch.load to replace the original UNet in the pipeline.
Run inference using the code below.
import os
import torch
from diffusers import DiffusionPipeline
from PIL import Image
# 1. Load the base SDXL model
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16)
# 2. Swap the original UNet with the pruned UNet checkpoint
# Note: Ensure the path points to your downloaded .pth file
pruned_unet_path = "/path/to/sparsity_30/unet_pruned.pth"
pipe.unet = torch.load(pruned_unet_path, weights_only=False)
pipe = pipe.to("cuda")
total_params = sum(p.numel() for p in pipe.unet.parameters())
print(f"Total UNet parameters: {total_params / 1e6:.2f} M")
image = pipe(
prompt="A ship sailing through a sea of clouds, golden hour, impasto oil painting, brush strokes visible, dreamlike atmosphere.",
negative_prompt=None,
height=1024,
width=1024,
num_inference_steps=30,
guidance_scale=7.0,
generator=torch.Generator("cuda").manual_seed(42)
).images[0]
image.save("output_pruned.png")
If you find this work useful, please consider citing:
@article{zhu2025obs,
title={OBS-Diff: Accurate Pruning For Diffusion Models in One-Shot},
author={Zhu, Junhan and Wang, Hesong and Su, Mingluo and Wang, Zefang and Wang, Huan},
journal={arXiv preprint arXiv:2510.06751},
year={2025}
}