OBS-Diff Structured Pruning for CyberRealistic (SD1.5)

OBS-Diff-sd1.5 provides structured-pruned checkpoints of the UNet from CyberRealistic, a Stable Diffusion 1.5-based checkpoint, compressed using the OBS-Diff framework. By leveraging an efficient one-shot pruning algorithm, this model reduces the parameter count of the UNet while maintaining high-fidelity image generation.

Sample Comparisons: Original vs. Pruned

Original Model Pruned Model
Original 0 Pruned 0
Original 1 Pruned 1
Original 2 Pruned 2

Note on prompts: Prompts were generated/refined using the CyberRealistic Prompt Helper GPT rather than used raw — feeding raw prompts directly into this checkpoint tends to produce less pleasing results.

Benchmark (768x512, 30 steps)

Metric Original UNet Pruned UNet
Parameters 859,520,964 559,206,852 (-34.9%)
Model weights VRAM 1639.4 MiB 1066.6 MiB
Inference speed 5.73 it/s 8.55 it/s

How to use

import torch
from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler

# 1. Load the base checkpoint
pipe = StableDiffusionPipeline.from_single_file(
    "/path/to/cyberrealistic_final.safetensors",
    torch_dtype=torch.float16,
).to("cuda")

# 2. Swap in the pruned UNet
pruned_unet = torch.load("/path/to/pruned_model.pth", weights_only=False, map_location="cuda")
pruned_unet.eval()
pipe.unet = pruned_unet

pipe.scheduler = DPMSolverMultistepScheduler.from_config(
    pipe.scheduler.config, algorithm_type="sde-dpmsolver++", use_karras_sigmas=True
)

image = pipe(
    prompt="your prompt here",
    negative_prompt="your negative prompt here",
    height=768, width=512,
    num_inference_steps=30,
    guidance_scale=7.0,
    generator=torch.Generator("cuda").manual_seed(2026),
).images[0]

image.save("output.png")

Citation

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}
}
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for NZUONG/OBS-Diff-CyberRealistic-SD1.5