Gradio WebUI demo for Stable Diffusion XL 1.0
Top 93.9% on sourcepulse
This repository provides a Gradio web UI demo for Stable Diffusion XL 1.0, targeting users who want to experiment with advanced image generation capabilities. It offers a user-friendly interface for generating high-quality images with features like a refiner model and multi-GPU support, simplifying the process of leveraging SDXL's power.
How It Works
The demo utilizes the Gradio SDK to create an interactive web interface. It loads both the base and refiner models for Stable Diffusion XL 1.0, allowing for a two-stage generation process that enhances image detail. The architecture supports data parallelism for multi-GPU acceleration and integrates optional features like Latent Consistency Models (LCM) LoRA and the faster SSD-1B model for improved performance.
Quick Start & Requirements
pip install accelerate transformers invisible-watermark numpy opencv-python safetensors gradio==3.11.0 git+https://github.com/huggingface/diffusers.git
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512 python app.py
Highlighted Details
MULTI_GPU=True
).torch.compile
support for potential inference speedups.OFFLOAD_BASE
, OFFLOAD_REFINER
) to reduce memory usage.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The demo's performance and memory requirements are substantial, necessitating powerful hardware. While torch.compile
is supported, it adds initial compilation overhead. Model offloading saves memory but slows down generation.
1 year ago
1 day