Skip to content

Commit

Permalink
Update documentation (huggingface#4422)
Browse files Browse the repository at this point in the history
* update documentation

* minor
  • Loading branch information
echarlaix authored Aug 2, 2023
1 parent 6c5bd2a commit 579b4b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docs/source/en/optimization/onnx.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ optimum-cli export onnx --model stabilityai/stable-diffusion-xl-base-1.0 --task

### Inference

To load an ONNX model and run inference with ONNX Runtime, you need to replace `StableDiffusionPipelineXL` with `ORTStableDiffusionPipelineXL` :
Here is an example of how you can load a SDXL ONNX model from [stabilityai/stable-diffusion-xl-base-1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) and run inference with ONNX Runtime :

```python
from optimum.onnxruntime import ORTStableDiffusionXLPipeline

pipeline = ORTStableDiffusionXLPipeline.from_pretrained("sd_xl_onnx")
model_id = "stabilityai/stable-diffusion-xl-base-1.0"
pipeline = ORTStableDiffusionXLPipeline.from_pretrained(model_id)
prompt = "sailing ship in storm by Leonardo da Vinci"
image = pipeline(prompt).images[0]
```
Expand Down
4 changes: 3 additions & 1 deletion docs/source/en/optimization/open_vino.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ You can find more examples in the optimum [documentation](https://huggingface.co

### Inference

Here is an example of how you can load a SDXL OpenVINO model from [stabilityai/stable-diffusion-xl-base-1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) and run inference with OpenVINO Runtime :

```python
from optimum.intel import OVStableDiffusionXLPipeline

model_id = "stabilityai/stable-diffusion-xl-base-1.0"
pipeline = OVStableDiffusionXLPipeline.from_pretrained(model_id, export=True)
pipeline = OVStableDiffusionXLPipeline.from_pretrained(model_id)
prompt = "sailing ship in storm by Rembrandt"
image = pipeline(prompt).images[0]
```
Expand Down

0 comments on commit 579b4b2

Please sign in to comment.