Views
No views yet
pip install optimum[openvino] diffusers --extra-index-url https://download.pytorch.org/whl/cpufrom optimum.intel.openvino import OVDiffusionPipeline
model_id = "OpenVINO/stable-diffusion-v1-5-fp16-ov"
pipeline = OVDiffusionPipeline.from_pretrained(model_id, safety_checker=None)
prompt = "sailing ship in storm by Rembrandt"
images = pipeline(prompt, num_inference_steps=20).imagespip install huggingface_hub
pip install openvino openvino-tokenizers openvino-genaiimport huggingface_hub as hf_hub
model_id = "OpenVINO/stable-diffusion-v1-5-fp16-ov"
model_path = "stable-diffusion-v1-5-fp16-ov"
hf_hub.snapshot_download(model_id, local_dir=model_path)
import openvino_genai as ov_genai
from PIL import Image
device = "CPU"
pipe = ov_genai.Text2ImagePipeline(model_path, device)
prompt = "sailing ship in storm by Rembrandt"
image_tensor = pipe.generate(prompt, num_inference_steps=20)
image = Image.fromarray(image_tensor.data[0])