Downloads · 30 days
0
wangkanai/sdxl-fp8
sdxl-fp8 is a text-to-image model from wangkanai. Use it when you need an image from a text prompt. It is set up for diffusers. The card lists the license as openrail++.
High-quality FP8 quantized SDXL checkpoint models for efficient text-to-image generation at 1024x1024 resolution. This repository contains FP8-optimized versions of SDXL base and SDXL-Turbo models, providing reduced m…
Downloads · 30 days
0
Access
Public
Updated Oct 14, 2025
Repo size
20.8 GB
Likes
3
Public
Click a slice to open those files.
.safetensors20.8 GB · 100%
From the Hugging Face model README
High-quality FP8 quantized SDXL checkpoint models for efficient text-to-image generation at 1024x1024 resolution. This repository contains FP8-optimized versions of SDXL base and SDXL-Turbo models, providing reduced memory footprint while maintaining image quality.
Stable Diffusion XL (SDXL) is Stability AI's flagship text-to-image model featuring a larger UNet backbone (2.6B parameters) and dual text encoders (OpenCLIP ViT-bigG and CLIP ViT-L) for superior prompt understanding and image quality at native 1024x1024 resolution.
SDXL-Turbo is a distilled variant enabling high-quality generation in 1-4 steps through Adversarial Diffusion Distillation (ADD), achieving up to 10x faster inference while maintaining image quality.
FP8 Quantization: These models use 8-bit floating point precision, reducing memory requirements by ~50% compared to FP16 versions while maintaining comparable image quality. FP8 models are ideal for systems with limited VRAM or when running multiple models simultaneously.
E:\huggingface\sdxl-fp8\
├── checkpoints\sdxl\
│ ├── sdxl-base.safetensors # 6.5 GB - SDXL Base 1.0
│ └── sdxl-turbo.safetensors # 13 GB - SDXL-Turbo (distilled)
└── diffusion_models\sdxl\ # (Empty - reserved for future components)
Total Repository Size: ~20 GB
| Model | Size | Format | Precision | Architecture | Parameters | Native Resolution |
|---|---|---|---|---|---|---|
| SDXL Base FP8 | 6.5 GB | safetensors | FP8 | UNet + Dual CLIP | 2.6B UNet | 1024x1024 |
| SDXL-Turbo FP8 | 13 GB | safetensors | FP8 | Distilled UNet | 2.6B UNet | 512x512 (optimized) |
Precision: FP8 (8-bit floating point quantization) Format: SafeTensors (secure tensor serialization) Text Encoders: OpenCLIP ViT-bigG-14 + CLIP ViT-L/14 Memory Advantage: ~50% reduction vs FP16 versions (13GB → 6.5GB for base, 26GB → 13GB for turbo)
xformers or torch.compile() for additional 20-30% speedupfrom diffusers import DiffusionPipeline
import torch
# Load SDXL base model from local checkpoint
pipe = DiffusionPipeline.from_single_file(
r"E:\huggingface\sdxl-fp8\checkpoints\sdxl\sdxl-base.safetensors",
torch_dtype=torch.float16,
use_safetensors=True
)
pipe.to("cuda")
# Enable memory-efficient attention (optional)
pipe.enable_xformers_memory_efficient_attention()
# Generate image
prompt = "a serene mountain landscape at sunset, photorealistic, 8k, detailed"
negative_prompt = "blurry, distorted, low quality, artifacts"
image = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
num_inference_steps=40,
guidance_scale=7.5,
width=1024,
height=1024
).images[0]
image.save("output.png")
from diffusers import AutoPipelineForText2Image
import torch
# Load SDXL-Turbo for accelerated inference
pipe = AutoPipelineForText2Image.from_single_file(
r"E:\huggingface\sdxl-fp8\checkpoints\sdxl\sdxl-turbo.safetensors",
torch_dtype=torch.float16
)
pipe.to("cuda")
# Turbo models work best with 1-4 steps and LOW guidance
prompt = "a cute cat wearing sunglasses, digital art"
image = pipe(
prompt=prompt,
num_inference_steps=4, # 1-4 steps optimal for Turbo
guidance_scale=0.0, # Turbo is trained for guidance_scale=0
width=512,
height=512
).images[0]
image.save("turbo_output.png")
# Place models in ComfyUI checkpoint directory:
# ComfyUI\models\checkpoints\
# Then load via ComfyUI interface as "sdxl-base" or "sdxl-turbo"
# Recommended ComfyUI settings for SDXL Base:
# - Sampler: DPM++ 2M Karras / Euler a
# - Steps: 30-50
# - CFG Scale: 7-9
# - Resolution: 1024x1024 or aspect ratio variations
# Recommended settings for SDXL-Turbo:
# - Sampler: Euler a
# - Steps: 1-4
# - CFG Scale: 1.0-2.0
# - Resolution: 512x512 (fastest) or 768x768
from diffusers import DiffusionPipeline, StableDiffusionXLImg2ImgPipeline
import torch
# Load base model
base = DiffusionPipeline.from_single_file(
r"E:\huggingface\sdxl-fp8\checkpoints\sdxl\sdxl-base.safetensors",
torch_dtype=torch.float16
).to("cuda")
# Generate base image
prompt = "majestic castle on a cliff, fantasy art, detailed"
image = base(
prompt=prompt,
num_inference_steps=40,
denoising_end=0.8, # End early for refiner
output_type="latent"
).images[0]
# Note: Refiner model not included in this repository
# Download separately from Hugging Face if needed:
# refiner = StableDiffusionXLImg2ImgPipeline.from_pretrained(
# "stabilityai/stable-diffusion-xl-refiner-1.0",
# torch_dtype=torch.float16
# ).to("cuda")
#
# refined_image = refiner(
# prompt=prompt,
# image=image,
# denoising_start=0.8
# ).images[0]
SDXL Base 1.0 (FP8):
SDXL-Turbo (FP8):
# FP8 models already use 50% less VRAM, but you can optimize further:
# Enable memory-efficient attention
pipe.enable_xformers_memory_efficient_attention()
# Or use scaled dot product attention (PyTorch 2.0+)
pipe.enable_attention_slicing()
# Enable VAE tiling for large images
pipe.enable_vae_tiling()
# CPU offloading for limited VRAM (even with FP8, useful for <6GB VRAM)
pipe.enable_model_cpu_offload()
# Sequential CPU offload for extreme memory constraints
pipe.enable_sequential_cpu_offload()
# FP8 provides inherent speed advantages on modern GPUs (RTX 40-series, H100)
# Compile UNet with torch.compile (PyTorch 2.0+)
pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True)
# Use faster samplers
# DPM++ 2M Karras: Good quality, ~25-35 steps
# Euler a: Fast, ~30-40 steps
# LCM: Ultra-fast with LCM-LoRA, ~4-8 steps
# Reduce resolution for faster inference
# 768x768: ~40% faster than 1024x1024
# 512x512: ~70% faster than 1024x1024
# Note: FP8 tensor cores on Ada/Hopper GPUs provide additional 10-20% speedup
# Use higher step counts for complex prompts
num_inference_steps = 50 # Default: 40
# Adjust CFG scale based on desired creativity
guidance_scale = 7.5 # Lower (5-7): more creative
# Higher (8-12): stronger prompt adherence
# Use negative prompts to avoid unwanted elements
negative_prompt = "blurry, bad anatomy, deformed, ugly, low quality"
# For SDXL-Turbo, use 1-4 steps and low guidance
num_inference_steps = 2
guidance_scale = 0.0
License: CreativeML Open RAIL++-M License
Stable Diffusion XL models are released under the CreativeML Open RAIL++-M license, which permits:
Restrictions:
Attribution: When using these models commercially, please credit Stability AI and link to the original model repository.
If you use SDXL models in your research or projects, please cite:
@misc{podell2023sdxl,
title={SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis},
author={Dustin Podell and Zion English and Kyle Lacey and Andreas Blattmann and Tim Dockhorn and Jonas Müller and Joe Penna and Robin Rombach},
year={2023},
eprint={2307.01952},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
For SDXL-Turbo:
@misc{sauer2023adversarial,
title={Adversarial Diffusion Distillation},
author={Axel Sauer and Dominik Lorenz and Andreas Blattmann and Robin Rombach},
year={2023},
eprint={2311.17042},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Out of Memory (OOM) Errors:
enable_model_cpu_offload() or enable_sequential_cpu_offload()pipe.enable_attention_slicing()pipe.enable_vae_tiling()Slow Generation:
pip install xformersPoor Image Quality:
SDXL-Turbo Specific:
Repository Maintained: October 2025 Models Updated: SDXL Base 1.0 FP8 (August 2024), SDXL-Turbo FP8 (August 2024) README Version: v1.3 Quantization: FP8 post-training quantization for memory efficiency