Update README.md
Browse files
README.md
CHANGED
@@ -4,7 +4,7 @@ pipeline_tag: text-to-image
|
|
4 |
|
5 |
# SDXS Onnx
|
6 |
|
7 |
-
Converted from
|
8 |
|
9 |
```
|
10 |
optimum-cli export onnx -m <local absolute path to original model> --task stable-diffusion ./mysdxs
|
@@ -26,4 +26,31 @@ image = pipeline(prompt, num_inference_steps=1, guidance_scale=0).images[0]
|
|
26 |
image.save("hello.png", "PNG")
|
27 |
```
|
28 |
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# SDXS Onnx
|
6 |
|
7 |
+
Converted from [IDKiro/sdxs-512-0.9](https://huggingface.co/IDKiro/sdxs-512-0.9) (i.e. the original one, without dreamshaper) through this command:
|
8 |
|
9 |
```
|
10 |
optimum-cli export onnx -m <local absolute path to original model> --task stable-diffusion ./mysdxs
|
|
|
26 |
image.save("hello.png", "PNG")
|
27 |
```
|
28 |
|
29 |
+
## Using with TAESD
|
30 |
+
|
31 |
+
(Not tested yet)
|
32 |
+
|
33 |
+
Consider using the Onnx converted model of TAESD at [deinferno/taesd-onnx](https://huggingface.co/deinferno/taesd-onnx) (Original model at [madebyollin/taesd](https://huggingface.co/madebyollin/taesd) )
|
34 |
+
|
35 |
+
Combined inference code:
|
36 |
+
|
37 |
+
```py
|
38 |
+
from huggingface_hub import snapshot_download
|
39 |
+
from diffusers.pipelines import OnnxRuntimeModel
|
40 |
+
from optimum.onnxruntime import ORTStableDiffusionPipeline
|
41 |
+
|
42 |
+
taesd_dir = snapshot_download(repo_id="deinferno/taesd-onnx")
|
43 |
+
|
44 |
+
pipeline = ORTStableDiffusionPipeline.from_pretrained(
|
45 |
+
"lemonteaa/sdxs-onnx",
|
46 |
+
vae_decoder_session = OnnxRuntimeModel.from_pretrained(f"{taesd_dir}/vae_decoder"),
|
47 |
+
vae_encoder_session = OnnxRuntimeModel.from_pretrained(f"{taesd_dir}/vae_encoder"),
|
48 |
+
revision="onnx")
|
49 |
+
|
50 |
+
prompt = "Sailing ship in storm by Leonardo da Vinci"
|
51 |
+
|
52 |
+
image = pipeline(prompt, num_inference_steps=1, guidance_scale=0).images[0]
|
53 |
+
|
54 |
+
image.save("hello.png", "PNG")
|
55 |
+
```
|
56 |
+
|