Skip to content

Commit

Permalink
Add SDXS-512-0.9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
rupeshs committed Mar 27, 2024
1 parent 256e1f6 commit 797d84b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 10 deletions.
20 changes: 19 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The following interfaces are available :
- WebUI
- CLI (CommandLine Interface)

🚀 Using __OpenVINO(SD Turbo)__, it took __1.7 seconds__ to create a single 512x512 image on a __Core i7-12700__.
🚀 Using __OpenVINO(SDXS-512-0.9)__, it took __0.82 seconds__ (820 milliseconds) to create a single 512x512 image on a __Core i7-12700__.

## Supported platforms⚡️

Expand All @@ -19,6 +19,20 @@ The following interfaces are available :
- Android + Termux
- Raspberry PI 4

## 🚀 Fast 1 step inference (SDXS-512-0.9)

### Inference Speed

Tested on Core i7-12700 to generate __512x512__ image(1 step).

__SDXS-512-0.9__

| Diffusion Pipeline | Latency |
| --------------------- | ------------- |
| Pytorch | 4.8s |
| OpenVINO | 3.8s |
| OpenVINO + TAESD | __0.82s__ |

## 🚀 Fast 1 step inference (SD/SDXL Turbo - Adversarial Diffusion Distillation,ADD)

Added support for ultra fast 1 step inference using [sdxl-turbo](https://huggingface.co/stabilityai/sdxl-turbo) model
Expand Down Expand Up @@ -125,6 +139,10 @@ If we enable Tiny decoder(TAESD) we can save some memory(2GB approx) for example
- Add multilora support,thanks [monstruosoft](https://github.com/monstruosoft)
- Add basic ControlNet v1.1 support(LCM-LoRA mode),thanks [monstruosoft](https://github.com/monstruosoft)
- Add ControlNet annotators(Canny,Depth,LineArt,MLSD,NormalBAE,Pose,SoftEdge,Shuffle)
- Add SDXS-512 0.9 support
- Add SDXS-512 0.9 OpenVINO,fast 1 step inference (0.8 seconds to generate 512x512 image)
- Default model changed to SDXS-512-0.9
- Faster realtime image generation

## 2 Steps fast inference (LCM)

Expand Down
1 change: 1 addition & 0 deletions configs/lcm-models.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rupeshs/sdxs-512-0.9-orig-vae
stabilityai/sd-turbo
rupeshs/SDXL-Lightning-2steps
stabilityai/sdxl-turbo
Expand Down
1 change: 1 addition & 0 deletions configs/openvino-lcm-models.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rupeshs/sdxs-512-0.9-openvino
rupeshs/sd-turbo-openvino
rupeshs/SDXL-Lightning-2steps-openvino-int8
rupeshs/sdxl-turbo-openvino-int8
Expand Down
6 changes: 3 additions & 3 deletions src/constants.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from os import environ

APP_VERSION = "v1.0.0 beta 27"
LCM_DEFAULT_MODEL = "stabilityai/sd-turbo"
LCM_DEFAULT_MODEL_OPENVINO = "rupeshs/sd-turbo-openvino"
APP_VERSION = "v1.0.0 beta 28"
LCM_DEFAULT_MODEL = "rupeshs/sdxs-512-0.9-orig-vae"
LCM_DEFAULT_MODEL_OPENVINO = "rupeshs/sdxs-512-0.9-openvino"
APP_NAME = "FastSD CPU"
APP_SETTINGS_FILE = "settings.yaml"
RESULTS_DIRECTORY = "results"
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/gui/app_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,10 @@ def generate_image(self):

if self.config.settings.lcm_diffusion_setting.use_openvino:
model_id = self.openvino_lcm_model_id.currentText()
self.config.settings.lcm_diffusion_setting.openvino_lcm_model_id = model_id
else:
model_id = self.lcm_model.currentText()

self.config.settings.lcm_diffusion_setting.lcm_model_id = model_id
self.config.settings.lcm_diffusion_setting.lcm_model_id = model_id

reshape_required = False
if self.config.settings.lcm_diffusion_setting.use_openvino:
Expand Down
9 changes: 5 additions & 4 deletions src/frontend/webui/realtime_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ def predict(
seed,
):
lcm_diffusion_setting = LCMDiffusionSetting()
lcm_diffusion_setting.openvino_lcm_model_id = "rupeshs/LCM-dreamshaper-v7-openvino"
lcm_diffusion_setting.openvino_lcm_model_id = "rupeshs/sdxs-512-0.9-openvino"
lcm_diffusion_setting.prompt = prompt
lcm_diffusion_setting.guidance_scale = 1.0
lcm_diffusion_setting.inference_steps = steps
lcm_diffusion_setting.seed = seed
lcm_diffusion_setting.use_seed = True
lcm_diffusion_setting.image_width = 256 if is_openvino_device() else 512
lcm_diffusion_setting.image_height = 256 if is_openvino_device() else 512
lcm_diffusion_setting.image_width = 512
lcm_diffusion_setting.image_height = 512
lcm_diffusion_setting.use_openvino = True if is_openvino_device() else False
lcm_diffusion_setting.use_tiny_auto_encoder = True
lcm_text_to_image.init(
DEVICE,
lcm_diffusion_setting,
Expand Down Expand Up @@ -116,7 +117,7 @@ def _get_footer_message() -> str:
with gr.Accordion("Advanced options", open=False):
steps = gr.Slider(
label="Steps",
value=4 if is_openvino_device() else 3,
value=1,
minimum=1,
maximum=6,
step=1,
Expand Down

0 comments on commit 797d84b

Please sign in to comment.