Skip to content

Commit a5d2ee9

Browse files
echarlaixyiyixuxu
andauthored
Add OpenVINO documentation (huggingface#2569)
* Add OpenVINO documentation * Update docs/source/en/optimization/open_vino.mdx Co-authored-by: YiYi Xu <[email protected]> --------- Co-authored-by: YiYi Xu <[email protected]>
1 parent 68545a1 commit a5d2ee9

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

docs/source/en/optimization/open_vino.mdx

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@ an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express o
1010
specific language governing permissions and limitations under the License.
1111
-->
1212

13-
# OpenVINO
1413

15-
Under construction 🚧
14+
# How to use OpenVINO for inference
15+
16+
🤗 [Optimum](https://github.com/huggingface/optimum-intel) provides a Stable Diffusion pipeline compatible with OpenVINO. You can now easily perform inference with OpenVINO Runtime on a variety of Intel processors ([see](https://docs.openvino.ai/latest/openvino_docs_OV_UG_supported_plugins_Supported_Devices.html) the full list of supported devices).
17+
18+
## Installation
19+
20+
Install 🤗 Optimum Intel with the following command:
21+
22+
```
23+
pip install optimum["openvino"]
24+
```
25+
26+
## Stable Diffusion Inference
27+
28+
To load an OpenVINO model and run inference with OpenVINO Runtime, you need to replace `StableDiffusionPipeline` with `OVStableDiffusionPipeline`. In case you want to load a PyTorch model and convert it to the OpenVINO format on-the-fly, you can set `export=True`.
29+
30+
```python
31+
from optimum.intel.openvino import OVStableDiffusionPipeline
32+
33+
model_id = "runwayml/stable-diffusion-v1-5"
34+
pipe = OVStableDiffusionPipeline.from_pretrained(model_id, export=True)
35+
prompt = "a photo of an astronaut riding a horse on mars"
36+
images = pipe(prompt).images[0]
37+
```
38+
39+
You can find more examples in [optimum documentation](https://huggingface.co/docs/optimum/intel/inference#export-and-inference-of-stable-diffusion-models).

0 commit comments

Comments
 (0)