Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from openvino.runtime import get_version
|
2 |
+
|
3 |
+
print(get_version())
|
4 |
+
from optimum.intel import OVStableDiffusionXLPipeline
|
5 |
+
from diffusers import DiffusionPipeline, LCMScheduler
|
6 |
+
import time
|
7 |
+
|
8 |
+
openvion版本要求高,但是不要用最新的
|
9 |
+
|
10 |
+
model_path = './ov-dmd-1step'
|
11 |
+
pipeline = OVStableDiffusionXLPipeline.from_pretrained(
|
12 |
+
model_path,
|
13 |
+
ov_config={"CACHE_DIR": "."},
|
14 |
+
)
|
15 |
+
|
16 |
+
pipeline.scheduler = LCMScheduler.from_config(pipeline.scheduler.config)
|
17 |
+
prompt = "a close-up picture of an old man standing in the rain"
|
18 |
+
|
19 |
+
image = pipeline(prompt = prompt, num_inference_steps=1,guidance_scale=0, timesteps=[399]).images[0]
|
20 |
+
image.save("ovgenerated_ship.png")
|