A newer version of the Gradio SDK is available:
5.23.1
metadata
title: Stable Diffusion Using Text Inversion
emoji: π
colorFrom: gray
colorTo: purple
sdk: gradio
sdk_version: 5.22.0
app_file: app.py
pinned: false
short_description: Stable Diffusion using Text Inversion
Stable Diffusion with Text Inversion and Style Transfer
A Gradio-based web application that generates images using Stable Diffusion with various style concepts and loss functions.
Features
- Text-to-image generation using Stable Diffusion v1.4
- Multiple pre-trained style concepts:
- Dreams
- Midjourney Style
- Moebius
- Marc Allante
- WLOP
- Five different image variations using loss functions:
- Original (No Loss)
- Blue Channel Loss
- Elastic Loss
- Symmetry Loss
- Saturation Loss
Requirements
- Python 3.8+
- PyTorch
- Diffusers
- Gradio
- PIL
- Torchvision
Installation
- Clone the repository:
git clone <repository-url>
cd stable-diffusion-using-text-inversion
- Install the required dependencies:
pip install -r requirements.txt
Usage
- Run the application:
python app.py
- Open your web browser and navigate to:
- Local URL: http://127.0.0.1:7860
- Or use the public URL provided in the terminal
- Select or enter a prompt and choose a style concept
- Click submit and wait for the images to generate.py
Image Generation Process
The application generates five variations of each image:
- Original Image : Base generation without modifications
- Blue Channel Loss : Enhanced blue tones for atmospheric effects
- Elastic Loss : Added elastic deformation for artistic distortion
- Symmetry Loss : Enforced symmetrical features
- Saturation Loss : Modified color saturation for vibrant effects
Performance Notes
- Image generation takes several minutes per set
- Uses 384x384 resolution for optimal speed/quality balance
- CUDA-enabled GPU recommended for faster generation
- Supports CPU, CUDA, and MPS (Apple Silicon) backends
License
MIT License
Acknowledgments
- Stable Diffusion by CompVis
- Textual Inversion concepts from Hugging Face's SD Concepts Library