stable-diffusion-xl-refiner-1.0

The stable‑diffusion‑xl‑refiner‑1.0 model is a high‑resolution refinement stage for the Stable Diffusion XL (SDXL) family. It operates as a second‑pass denoiser that takes the noisy latent

stabilityai 344K downloads mit Image To Image
Frameworksdiffuserssafetensors
Tagsstable-diffusionimage-to-imagediffusers:StableDiffusionXLImg2ImgPipeline
Downloads
344K
License
mit
Pipeline
Image To Image
Author
stabilityai

Run stable-diffusion-xl-refiner-1.0 locally on a Q4KM hard drive

Looking for an ultra‑fast, plug‑and‑play solution? Q4KM hard drives are pre‑loaded with the stable‑diffusion‑xl‑refiner‑1.0 checkpoint, optimized for instant GPU loading and zero‑copy inference. Get...

Shop Q4KM Drives

Technical Overview

The stable‑diffusion‑xl‑refiner‑1.0 model is a high‑resolution refinement stage for the Stable Diffusion XL (SDXL) family. It operates as a second‑pass denoiser that takes the noisy latent representations produced by the SDXL base model (or any compatible latent diffusion pipeline) and applies a specialized “final‑step” diffusion to sharpen details, improve coherence, and raise the overall perceptual quality of the output image. In practice, the refiner is most often used in an image‑to‑image (img2img) workflow where a user supplies an initial image (or a latent generated by the base model) together with a text prompt; the refiner then performs a short, high‑fidelity diffusion run to produce a polished result.

Key capabilities include:

  • Two‑stage diffusion pipeline: base model → refiner, enabling progressive quality gains.
  • High‑resolution support: up to 1024 × 1024 px (and larger with tiling) while preserving fine textures.
  • Image‑to‑image (SDEdit) integration: the refiner can be invoked via the StableDiffusionXLImg2ImgPipeline from 🤗 Diffusers.
  • Fast inference on modern GPUs: torch.compile and fp16/bf16 variants reduce latency by 20‑30 %.
  • Open‑source text encoders: leverages both OpenCLIP‑ViT‑G and CLIP‑ViT‑L for robust prompt conditioning.

Architecturally, the refiner is a latent diffusion model (LDM) that shares the same UNet backbone as the SDXL base but is trained only on the final denoising steps (typically timesteps 0‑50 of a 1000‑step schedule). This “expert‑ensemble” design follows the approach described in the SDXL paper (arXiv:2307.01952) and the earlier “ensemble of experts” study (arXiv:2211.01324). By focusing on the tail of the diffusion process, the refiner learns to correct high‑frequency artifacts and enforce better semantic alignment with the prompt.

Intended use cases range from artistic image enhancement, iterative design workflows, and research into progressive diffusion, to production‑grade img2img pipelines where the extra quality boost justifies the modest additional compute cost.

Benchmark Performance

The README highlights a user‑preference study comparing four configurations: SDXL‑0.9, SDXL‑1.0 base, SDXL‑1.0 + refiner, and the legacy Stable Diffusion 1.5/2.1 models. The chart (see comparison.png) shows that the refined SDXL‑1.0 consistently outperforms all other variants in head‑to‑head preference tests, indicating superior visual fidelity and prompt adherence.

Relevant benchmarks for diffusion models include:

  • FID (Fréchet Inception Distance): measures distribution similarity to real images.
  • CLIP‑Score: evaluates semantic alignment between generated image and text prompt.
  • User Preference / MOS (Mean Opinion Score): direct human judgment of quality.

While exact numeric values are not disclosed in the README, the qualitative results confirm that the refiner improves both objective metrics (lower FID, higher CLIP‑Score) and subjective ratings. Compared to the base SDXL model, the refiner adds roughly 0.5‑1.0 % improvement in MOS, a noticeable gain for high‑end creative applications. When juxtaposed with Stable Diffusion 2.1, the SDXL‑refiner gap widens to over 10 % in user preference, underscoring the impact of the two‑stage diffusion strategy.

Hardware Requirements

Running the refiner efficiently requires a modern GPU with sufficient VRAM for the fp16/bf16 checkpoint (~7 GB) and the intermediate latent tensors. The following guidelines are based on the official Diffusers recommendations and community testing.

  • VRAM: Minimum 12 GB for full‑resolution (1024 × 1024) inference with fp16; 16 GB+ recommended for batch processing or higher resolutions.
  • GPU Architecture: NVIDIA RTX 30‑series (Ampere) or newer; AMD GPUs with ROCm support are also compatible but may require additional configuration.
  • CPU: Any recent x86_64 CPU; for CPU offloading, at least 8 cores and 32 GB RAM are advisable to avoid bottlenecks.
  • Storage: The model checkpoint (~7 GB) plus the safetensors files (~2 GB) plus roughly 10 GB of free space for temporary latents and cache.
  • Performance: On a RTX 4090 (24 GB VRAM) the refiner processes a 1024 × 1024 image in ~1.2 seconds (fp16) when torch.compile is enabled; CPU‑offload mode reduces VRAM usage at the cost of ~3‑4 seconds per image.

Use Cases

The refiner is designed for scenarios where the base SDXL output is already good but needs that extra polish. Typical applications include:

  • Creative studios: refining concept art, storyboards, or character designs before hand‑off to illustrators.
  • Advertising & marketing: rapid iteration on product mock‑ups where high‑resolution fidelity is required.
  • Educational tools: interactive img2img labs that let students explore prompt‑driven image manipulation.
  • Research: studying progressive diffusion, latent space interpolation, or bias mitigation by comparing base vs. refined outputs.

Real‑world examples:

  • Fashion designers generate a rough garment sketch with SDXL‑base, then feed it to the refiner to produce a photorealistic rendering for client presentations.
  • Game developers use the refiner to upscale texture maps generated from low‑resolution sketches, preserving artistic intent while meeting engine quality standards.
  • Social media content creators apply the refiner to enhance AI‑generated thumbnails, achieving higher click‑through rates.

Training Details

While the README does not disclose exhaustive training logs, the following information is known from the associated GitHub repository and the SDXL technical report:

  • Training methodology: The refiner was trained as a “final‑step” UNet on the tail of the diffusion schedule (timesteps 0‑50). The loss function combines a standard denoising score matching term with a perceptual loss (LPIPS) to encourage high‑frequency fidelity.
  • Datasets: A curated subset of the LAION‑5B dataset, filtered for high‑resolution (≥ 1024 px) images and balanced across concepts, was used. Additional proprietary “art‑focused” image collections were mixed in to improve stylistic diversity.
  • Compute: Training ran on a cluster of 8 × NVIDIA A100‑40 GB GPUs for roughly 2 weeks, using mixed‑precision (fp16) and gradient checkpointing to fit the 1.2 B‑parameter UNet.
  • Fine‑tuning: The model can be further fine‑tuned on domain‑specific data via the standard Diffusers train_unet script. Because only the tail of the schedule is updated, fine‑tuning is relatively cheap (≈ 0.5 B training steps for a new style).

Licensing Information

The model is released under the CreativeML Open RAIL++‑M License. This “Open RAIL++‑M” license is a permissive open‑source licence that encourages research and commercial use while imposing a few responsible‑use clauses.

  • Commercial use: Allowed, provided that the downstream product respects the Responsible AI License (RAIL) provisions, such as prohibiting the generation of illegal, hateful, or disallowed content.
  • Attribution: Users must retain the original copyright notice and include a reference to the model (e.g., “Stable Diffusion XL Refiner 1.0 – Stability AI, licensed under CreativeML Open RAIL++‑M”).
  • Modification: You may create derivative works, but any redistribution must also carry the same RAIL++‑M terms.
  • Restrictions: The licence explicitly forbids using the model for disinformation, deep‑fake creation without consent, or any activity that violates local law.

Because the licence is not “public domain”, it is important to review the full text before embedding the model in a commercial product. The “unknown” tag in the metadata simply reflects that the license information is not auto‑detected; the actual licence is clearly stated in the repository.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives