diff --git a/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/imgs/access_request.png b/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/imgs/access_request.png new file mode 100644 index 0000000000000000000000000000000000000000..1a19908c64bd08dcba67f10375813d2821bf6f66 --- /dev/null +++ b/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/imgs/access_request.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9688dabf75e180590251cd1f75d18966f9c94d5d6584bc7d0278b698c175c61f +size 104814 diff --git a/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/imgs/diffusers_library.jpg b/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/imgs/diffusers_library.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c2f8c529a69d4e01f4601bfc435ae90b24659fca --- /dev/null +++ b/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/imgs/diffusers_library.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be2485d6656bec11b85f469b2bc04736a8de8270fa2f3779d9d40bfab3966950 +size 14061 diff --git a/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/index.md b/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/index.md new file mode 100644 index 0000000000000000000000000000000000000000..0aca1d22c142b29eadd0e417680e9930f0ebc59b --- /dev/null +++ b/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/index.md @@ -0,0 +1,35 @@ + + +
+
+
+
+
+
+
+Feel free to check out more guides and examples on different use cases from the Optimum Neuron [documentation](https://huggingface.co/docs/optimum-neuron/en/inference_tutorials/stable_diffusion#generate-images-with-stable-diffusion-models-on-aws-inferentia)!
diff --git a/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/optimization/onnx.md b/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/optimization/onnx.md
new file mode 100644
index 0000000000000000000000000000000000000000..620f2af994b36266de67ea8f8b8e584142da2723
--- /dev/null
+++ b/tasks/tasksmith-83a0918520ec/tests/source/docs/source/en/optimization/onnx.md
@@ -0,0 +1,83 @@
+
+
+# ONNX Runtime
+
+🤗 [Optimum](https://github.com/huggingface/optimum) provides a Stable Diffusion pipeline compatible with ONNX Runtime. You'll need to install 🤗 Optimum with the following command for ONNX Runtime support:
+
+```bash
+pip install -q optimum["onnxruntime"]
+```
+
+This guide will show you how to use the Stable Diffusion and Stable Diffusion XL (SDXL) pipelines with ONNX Runtime.
+
+## Stable Diffusion
+
+To load and run inference, use the [`~optimum.onnxruntime.ORTStableDiffusionPipeline`]. If you want to load a PyTorch model and convert it to the ONNX format on-the-fly, set `export=True`:
+
+```python
+from optimum.onnxruntime import ORTStableDiffusionPipeline
+
+model_id = "stable-diffusion-v1-5/stable-diffusion-v1-5"
+pipeline = ORTStableDiffusionPipeline.from_pretrained(model_id, export=True)
+prompt = "sailing ship in storm by Leonardo da Vinci"
+image = pipeline(prompt).images[0]
+pipeline.save_pretrained("./onnx-stable-diffusion-v1-5")
+```
+
+> [!WARNING]
+> Generating multiple prompts in a batch seems to take too much memory. While we look into it, you may need to iterate instead of batching.
+
+To export the pipeline in the ONNX format offline and use it later for inference,
+use the [`optimum-cli export`](https://huggingface.co/docs/optimum/main/en/exporters/onnx/usage_guides/export_a_model#exporting-a-model-to-onnx-using-the-cli) command:
+
+```bash
+optimum-cli export onnx --model stable-diffusion-v1-5/stable-diffusion-v1-5 sd_v15_onnx/
+```
+
+Then to perform inference (you don't have to specify `export=True` again):
+
+```python
+from optimum.onnxruntime import ORTStableDiffusionPipeline
+
+model_id = "sd_v15_onnx"
+pipeline = ORTStableDiffusionPipeline.from_pretrained(model_id)
+prompt = "sailing ship in storm by Leonardo da Vinci"
+image = pipeline(prompt).images[0]
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+