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