MilindChawre's picture
Updating readme.md
048d5e5

A newer version of the Gradio SDK is available: 5.23.1

Upgrade
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:
    1. Original (No Loss)
    2. Blue Channel Loss
    3. Elastic Loss
    4. Symmetry Loss
    5. Saturation Loss

Requirements

  • Python 3.8+
  • PyTorch
  • Diffusers
  • Gradio
  • PIL
  • Torchvision

Installation

  1. Clone the repository:
git clone <repository-url>
cd stable-diffusion-using-text-inversion
  1. Install the required dependencies:
pip install -r requirements.txt

Usage

  1. Run the application:
python app.py
  1. Open your web browser and navigate to:
  1. Select or enter a prompt and choose a style concept
  2. Click submit and wait for the images to generate.py

Image Generation Process

The application generates five variations of each image:

  1. Original Image : Base generation without modifications
  2. Blue Channel Loss : Enhanced blue tones for atmospheric effects
  3. Elastic Loss : Added elastic deformation for artistic distortion
  4. Symmetry Loss : Enforced symmetrical features
  5. 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