Update README.md
Browse files
README.md
CHANGED
@@ -20,7 +20,7 @@ The provided OpenVINO™ IR model is compatible with:
|
|
20 |
* OpenVINO version 2024.5.0 and higher
|
21 |
* Optimum Intel 1.21.0 and higher
|
22 |
|
23 |
-
## Running Model Inference
|
24 |
|
25 |
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
26 |
|
@@ -31,7 +31,7 @@ pip install optimum[openvino]
|
|
31 |
2. Run model inference:
|
32 |
|
33 |
```
|
34 |
-
from optimum.intel.openvino import
|
35 |
|
36 |
model_id = "OpenVINO/LCM_Dreamshaper_v7-fp16-ov"
|
37 |
pipeline = OVStableDiffusionPipeline.from_pretrained(model_id)
|
@@ -40,12 +40,42 @@ prompt = "sailing ship in storm by Rembrandt"
|
|
40 |
images = pipeline(prompt, num_inference_steps=4).images
|
41 |
```
|
42 |
|
43 |
-
##
|
44 |
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
## Legal information
|
51 |
|
|
|
20 |
* OpenVINO version 2024.5.0 and higher
|
21 |
* Optimum Intel 1.21.0 and higher
|
22 |
|
23 |
+
## Running Model Inference with [Optimum Intel](https://huggingface.co/docs/optimum/intel/index)
|
24 |
|
25 |
1. Install packages required for using [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) integration with the OpenVINO backend:
|
26 |
|
|
|
31 |
2. Run model inference:
|
32 |
|
33 |
```
|
34 |
+
from optimum.intel.openvino import OVDiffusionPipeline
|
35 |
|
36 |
model_id = "OpenVINO/LCM_Dreamshaper_v7-fp16-ov"
|
37 |
pipeline = OVStableDiffusionPipeline.from_pretrained(model_id)
|
|
|
40 |
images = pipeline(prompt, num_inference_steps=4).images
|
41 |
```
|
42 |
|
43 |
+
## Running Model Inference with [OpenVINO GenAI](https://github.com/openvinotoolkit/openvino.genai)
|
44 |
|
45 |
+
1. Install packages required for using OpenVINO GenAI.
|
46 |
+
```
|
47 |
+
pip install huggingface_hub
|
48 |
+
pip install -U --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly openvino openvino-tokenizers openvino-genai
|
49 |
+
```
|
50 |
+
|
51 |
+
2. Download model from HuggingFace Hub
|
52 |
+
|
53 |
+
```
|
54 |
+
import huggingface_hub as hf_hub
|
55 |
+
|
56 |
+
model_id = "OpenVINO/LCM_Dreamshaper_v7-fp16-ov"
|
57 |
+
model_path = "LCM_Dreamshaper_v7-fp16-ov"
|
58 |
+
|
59 |
+
hf_hub.snapshot_download(model_id, local_dir=model_path)
|
60 |
+
|
61 |
+
```
|
62 |
+
|
63 |
+
3. Run model inference:
|
64 |
+
|
65 |
+
```
|
66 |
+
import openvino_genai as ov_genai
|
67 |
+
from PIL import Image
|
68 |
+
|
69 |
+
device = "CPU"
|
70 |
+
pipe = ov_genai.Text2ImagePipeline(model_path, device)
|
71 |
+
|
72 |
+
prompt = "sailing ship in storm by Rembrandt"
|
73 |
+
image_tensor = pipe.generate(prompt, num_inference_steps=4)
|
74 |
+
image = Image.fromarray(image_tensor.data[0])
|
75 |
+
|
76 |
+
```
|
77 |
+
|
78 |
+
More GenAI usage examples can be found in OpenVINO GenAI library [docs](https://github.com/openvinotoolkit/openvino.genai/blob/master/src/README.md) and [samples](https://github.com/openvinotoolkit/openvino.genai?tab=readme-ov-file#openvino-genai-samples)
|
79 |
|
80 |
## Legal information
|
81 |
|