Delete README.md
Browse files
README.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
| 1 |
-
# stable_diffusion.openvino
|
| 2 |
-
|
| 3 |
-
Implementation of Text-To-Image generation using Stable Diffusion on Intel CPU.
|
| 4 |
-
<p align="center">
|
| 5 |
-
<img src="data/title.png"/>
|
| 6 |
-
</p>
|
| 7 |
-
|
| 8 |
-
## News
|
| 9 |
-
|
| 10 |
-
When we started this project, it was just a tiny proof of concept that you can work with state-of-the-art image generators even without access to expensive hardware.
|
| 11 |
-
But, due we get a lot of feedback from you, we decided to make this project something more than a tiny script.
|
| 12 |
-
Currently, we work on the new version of our project, so we can respond to your issues and pool requests with delay.
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
## Requirements
|
| 16 |
-
|
| 17 |
-
* Linux, Windows, MacOS
|
| 18 |
-
* Python 3.8.+
|
| 19 |
-
* CPU compatible with OpenVINO.
|
| 20 |
-
|
| 21 |
-
## Install requirements
|
| 22 |
-
|
| 23 |
-
```bash
|
| 24 |
-
pip install -r requirements.txt
|
| 25 |
-
```
|
| 26 |
-
|
| 27 |
-
## Generate image from text description
|
| 28 |
-
|
| 29 |
-
```bash
|
| 30 |
-
usage: demo.py [-h] [--model MODEL] [--seed SEED] [--beta-start BETA_START] [--beta-end BETA_END] [--beta-schedule BETA_SCHEDULE] [--num-inference-steps NUM_INFERENCE_STEPS]
|
| 31 |
-
[--guidance-scale GUIDANCE_SCALE] [--eta ETA] [--tokenizer TOKENIZER] [--prompt PROMPT] [--init-image INIT_IMAGE] [--strength STRENGTH] [--mask MASK] [--output OUTPUT]
|
| 32 |
-
|
| 33 |
-
optional arguments:
|
| 34 |
-
-h, --help show this help message and exit
|
| 35 |
-
--model MODEL model name
|
| 36 |
-
--seed SEED random seed for generating consistent images per prompt
|
| 37 |
-
--beta-start BETA_START
|
| 38 |
-
LMSDiscreteScheduler::beta_start
|
| 39 |
-
--beta-end BETA_END LMSDiscreteScheduler::beta_end
|
| 40 |
-
--beta-schedule BETA_SCHEDULE
|
| 41 |
-
LMSDiscreteScheduler::beta_schedule
|
| 42 |
-
--num-inference-steps NUM_INFERENCE_STEPS
|
| 43 |
-
num inference steps
|
| 44 |
-
--guidance-scale GUIDANCE_SCALE
|
| 45 |
-
guidance scale
|
| 46 |
-
--eta ETA eta
|
| 47 |
-
--tokenizer TOKENIZER
|
| 48 |
-
tokenizer
|
| 49 |
-
--prompt PROMPT prompt
|
| 50 |
-
--init-image INIT_IMAGE
|
| 51 |
-
path to initial image
|
| 52 |
-
--strength STRENGTH how strong the initial image should be noised [0.0, 1.0]
|
| 53 |
-
--mask MASK mask of the region to inpaint on the initial image
|
| 54 |
-
--output OUTPUT output image name
|
| 55 |
-
```
|
| 56 |
-
|
| 57 |
-
## Examples
|
| 58 |
-
|
| 59 |
-
### Example Text-To-Image
|
| 60 |
-
```bash
|
| 61 |
-
python demo.py --prompt "Street-art painting of Emilia Clarke in style of Banksy, photorealism"
|
| 62 |
-
```
|
| 63 |
-
|
| 64 |
-
### Example Image-To-Image
|
| 65 |
-
```bash
|
| 66 |
-
python demo.py --prompt "Photo of Emilia Clarke with a bright red hair" --init-image ./data/input.png --strength 0.5
|
| 67 |
-
```
|
| 68 |
-
|
| 69 |
-
### Example Inpainting
|
| 70 |
-
```bash
|
| 71 |
-
python demo.py --prompt "Photo of Emilia Clarke with a bright red hair" --init-image ./data/input.png --mask ./data/mask.png --strength 0.5
|
| 72 |
-
```
|
| 73 |
-
|
| 74 |
-
### Example web demo
|
| 75 |
-
<p align="center">
|
| 76 |
-
<img src="data/demo_web.png"/>
|
| 77 |
-
</p>
|
| 78 |
-
|
| 79 |
-
[Example video on YouTube](https://youtu.be/wkbrRr6PPcY)
|
| 80 |
-
|
| 81 |
-
```bash
|
| 82 |
-
streamlit run demo_web.py
|
| 83 |
-
```
|
| 84 |
-
|
| 85 |
-
## Performance
|
| 86 |
-
|
| 87 |
-
| CPU | Time per iter | Total time |
|
| 88 |
-
|-------------------------------------------------------|---------------|------------|
|
| 89 |
-
| AMD Ryzen Threadripper 1900X | 5.34 s/it | 2.58 min |
|
| 90 |
-
| Intel(R) Core(TM) i7-4790K @ 4.00GHz | 10.1 s/it | 5.39 min |
|
| 91 |
-
| Intel(R) Core(TM) i5-8279U | 7.4 s/it | 3.59 min |
|
| 92 |
-
| Intel(R) Core(TM) i7-1165G7 @ 2.80GHz | 7.4 s/it | 3.59 min |
|
| 93 |
-
| Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 threads) | 2.9 s/it | 1.54 min |
|
| 94 |
-
| Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz | 1 s/it | 33 s |
|
| 95 |
-
|
| 96 |
-
## Acknowledgements
|
| 97 |
-
|
| 98 |
-
* Original implementation of Stable Diffusion: https://github.com/CompVis/stable-diffusion
|
| 99 |
-
* diffusers library: https://github.com/huggingface/diffusers
|
| 100 |
-
|
| 101 |
-
## Disclaimer
|
| 102 |
-
|
| 103 |
-
The authors are not responsible for the content generated using this project.
|
| 104 |
-
Please, don't use this project to produce illegal, harmful, offensive etc. content.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|