Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,19 @@
|
|
1 |
-
from diffusers import DiffusionPipeline, LCMScheduler
|
|
|
2 |
from optimum.intel import OVStableDiffusionXLPipeline
|
3 |
import gradio as gr
|
4 |
|
5 |
-
|
6 |
-
|
7 |
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
|
8 |
pipe = DiffusionPipeline.from_pretrained(model_id)
|
|
|
|
|
9 |
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
|
|
|
|
|
10 |
pipe.load_lora_weights("latent-consistency/lcm-lora-sdxl")
|
|
|
|
|
11 |
pipeline = OVStableDiffusionXLPipeline.from_pretrained(
|
12 |
pipe,
|
13 |
export=True
|
|
|
1 |
+
from diffusers import DiffusionPipeline, LCMScheduler
|
2 |
+
from diffusers.models.modeling_outputs import Transformer2DModelOutput
|
3 |
from optimum.intel import OVStableDiffusionXLPipeline
|
4 |
import gradio as gr
|
5 |
|
6 |
+
# Loading the model
|
|
|
7 |
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
|
8 |
pipe = DiffusionPipeline.from_pretrained(model_id)
|
9 |
+
|
10 |
+
# Setting the scheduler
|
11 |
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
|
12 |
+
|
13 |
+
# Loading LoRA weights
|
14 |
pipe.load_lora_weights("latent-consistency/lcm-lora-sdxl")
|
15 |
+
|
16 |
+
# Converting the model to OpenVINO format
|
17 |
pipeline = OVStableDiffusionXLPipeline.from_pretrained(
|
18 |
pipe,
|
19 |
export=True
|