File size: 1,741 Bytes
a240ddb
 
 
 
 
 
 
 
 
 
 
 
45b110b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
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 using Text Inversion

A Gradio web application that generates images using Stable Diffusion with various text inversion concepts and loss functions.

## Features

- Generate images using Stable Diffusion v1.4
- Apply different artistic styles using text inversion concepts:
  - Dreams
  - Midjourney Style
  - Moebius
  - Marc Allante
  - WLOP
- Automatic application of multiple loss functions:
  - No Loss (Base generation)
  - Blue Channel Loss
  - Elastic Transformation Loss
  - Symmetry Loss
  - Saturation Loss
- User-friendly interface with preset prompts and custom prompt input
- Side-by-side comparison of different loss function effects

## Usage

1. Select a preset prompt or enter your own custom prompt
2. Choose a style concept from the dropdown menu
3. Click "Submit" to generate images
4. View the results showing different loss function effects side by side

## Installation

1. Clone this repository
2. Install the required dependencies:
```bash
pip install -r requirements.txt
```
3. Run the application:
```bash
python app.py
```

## Requirements
- Python 3.7+
- PyTorch
- Diffusers
- Transformers
- Gradio
- Torchvision
- PIL

## Model Details
The application uses the CompVis/stable-diffusion-v1-4 model with text inversion concepts from the Hugging Face SD concepts library. The model runs with float16 precision and supports CUDA, MPS, and CPU devices.

## License
This project uses the CompVis/stable-diffusion-v1-4 model which is subject to the CreativeML Open RAIL-M license.