You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 27, 2024. It is now read-only.
OnnxStack transforms machine learning in .NET, Seamlessly integrating with `ONNX Runtime` and `Microsoft ML`, this library empowers you to build, deploy, and execute machine learning models entirely within the .NET ecosystem. Bid farewell to Python dependencies and embrace a new era of intelligent applications tailored for .NET
25
17
Welcome to Python-free AI integration with OnnxStack!
<imgsrc="Assets/Samples/624461087_22_8_LMSScheduler.png"width="256"alt="Image of browser inferencing on sample images."/> | <imgsrc="Assets/Samples/624461087_22_8_EulerAncestralScheduler.png"width="256"alt="Image of browser inferencing on sample images."/> |<imgsrc="Assets/Samples/624461087_22_8_DDPMScheduler.png"width="256"alt="Image of browser inferencing on sample images."/> |
Text To Image Stable Diffusion is a powerful machine learning technique that allows you to generate high-quality images from textual descriptions. It combines the capabilities of text understanding and image synthesis to convert natural language descriptions into visually coherent and meaningful images
70
-
71
-
| Input Text | Output Image | Diffusion Steps |
72
-
| :--- | :--- | :--- |
73
-
<imgsrc="Assets/Samples/Text2Img_Start.png"width="256"alt="Image of browser inferencing on sample images."/> | <imgsrc="Assets/Samples/Text2Img_End.png"width="256"alt="Image of browser inferencing on sample images."/> |<imgsrc="Assets/Samples/Text2Img_Animation.webp"width="256"alt="Image of browser inferencing on sample images."/> |
74
-
75
-
### **Image To Image**
76
-
Image To Image Stable Diffusion is an advanced image processing and generation method that excels in transforming one image into another while preserving the visual quality and structure of the original content. Using stable diffusion, this technique can perform a wide range of image-to-image tasks, such as style transfer, super-resolution, colorization, and more
77
-
78
-
| Input Image | Output Image | Diffusion Steps |
79
-
| :--- | :--- | :--- |
80
-
<imgsrc="Assets/Samples/Img2Img_Start.bmp"width="256"alt="Image of browser inferencing on sample images."/> | <imgsrc="Assets/Samples/Img2Img_End.png"width="256"alt="Image of browser inferencing on sample images."/> |<imgsrc="Assets/Samples/Img2Img_Animation.webp"width="256"alt="Image of browser inferencing on sample images."/> |
81
-
82
-
```
83
-
Prompt: Dog wearing storm trooper helmet, head shot
Image inpainting is an image modification/restoration technique that intelligently fills in missing or damaged portions of an image while maintaining visual consistency. It's used for tasks like photo restoration and object removal, creating seamless and convincing results.
30
+
`OnnxStack.Core` is a .NET library designed to facilitate seamless interaction with the `OnnxRuntime` C# API. This project simplifies the creation and disposal of `OrtValues` and offers straightforward services for loading and running inferences on a variety of models. With a focus on improving developer efficiency, the library abstracts complexities, allowing for smoother integration of `OnnxRuntime` into .NET applications. Explore the documentation for detailed usage instructions and take advantage of simplified workflows for managing `OrtValues` and conducting inferences effortlessly.
88
31
89
-
In the below example we use a simple mask image + prompt to add a rider to the horse
90
-
The black part of the mask will be used buy the process to generate new content, in this case the rider
32
+
More information and Examples can be found in the `OnnxStack.Core` project **[README](OnnxStack.Core/README.md)**
<imgsrc="Assets/Samples/Inpaint-Original.png"width="256"alt="Image of browser inferencing on sample images."/> | <imgsrc="Assets/Samples/Inpaint-Mask.png"width="256"alt="Image of browser inferencing on sample images."/> |<imgsrc="Assets/Samples/Inpaint-MaskedImage.PNG"width="256"alt="Image of browser inferencing on sample images."/> |<imgsrc="Assets/Samples/Inpaint-Result.png"width="256"alt="Image of browser inferencing on sample images."/> |
34
+
__________________________
95
35
96
-
```
97
-
Prompt: Rider on horse
98
-
```
36
+
__________________________
99
37
100
38
101
-
## **Realtime Stable Diffusion**
102
-
Realtime stable diffusion is a process where the results are constantly rendered as you are working with the image or changing the settings, This can be fantastic if you are creating new artworks or editing existing images.
`OnnxStack.StableDiffusion` is a .NET library for latent diffusion in C#, Leveraging `OnnxStack.Core`, this library seamlessly integrates many StableDiffusion capabilities, including
`OnnxStack.ImageUpscaler` is a library designed to elevate image quality through superior upscaling techniques. Leveraging `OnnxStack.Core`, this library provides seamless integration for enhancing image resolution and supports a variety of upscaling models, allowing developers to improve image clarity and quality. Whether you are working on image processing, content creation, or any application requiring enhanced visuals, the ImageUpscale project delivers efficient and high-quality upscaling solutions. Explore the documentation for comprehensive usage details and harness the power of OnnxRuntime for advanced image upscaling in your applications.
121
70
122
-
More information and Examples can be found in the `OnnxStack.StableDiffusion` project **[README](OnnxStack.StableDiffusion/README.md)**
123
71
72
+
More information and Examples can be found in the `OnnxStack.ImageUpscaler` project **[README](OnnxStack.ImageUpscaler/README.md)**
124
73
__________________________
125
-
126
-
127
74
__________________________
128
75
## **[OnnxStack.ImageRecognition]()**
129
76
**Image recognition with ResNet50v2 and ONNX Runtime**
@@ -145,61 +92,20 @@ Enable robust object detection in your applications using RCNN (Region-based Con
145
92
__________________________
146
93
147
94
148
-
# Getting Started
149
-
150
-
151
-
## ONNX Model Download
152
-
You will need an ONNX compatible model to use, Hugging Face is a great place to download the Stable Diffusion models
153
-
154
-
Download the [ONNX Stable Diffusion models from Hugging Face](https://huggingface.co/models?sort=downloads&search=Stable+Diffusion).
Once you have selected a model version repo, click `Files and Versions`, then select the `ONNX` branch. If there isn't an ONNX model branch available, use the `main` branch and convert it to ONNX. See the [ONNX conversion tutorial for PyTorch](https://learn.microsoft.com/windows/ai/windows-ml/tutorials/pytorch-convert-model) for more information.
You can choose between `Cpu` and `DirectML`(GPU) for inference,
184
-
Other `Microsoft.ML.OnnxRuntime.*` executors like `Cuda` may work but are untested
185
-
186
-
`Cpu` > 12GB RAM
187
-
188
-
`DirectML` > 10GB VRAM
189
-
190
95
## Contribution
191
96
192
97
We welcome contributions to OnnxStack! If you have any ideas, bug reports, or improvements, feel free to open an issue or submit a pull request.
193
98
194
-
195
-
196
99
__________________________
197
-
## Resources
100
+
## ONNX Runtime Resources
198
101
-[ONNX Runtime C# API Doc](https://onnxruntime.ai/docs/api/csharp/api)
199
102
-[Get Started with C# in ONNX Runtime](https://onnxruntime.ai/docs/get-started/with-csharp.html)
200
-
-[Hugging Face Stable Diffusion Blog](https://huggingface.co/blog/stable_diffusion)
201
-
-[ONNX Runtime tutorial for Stable Diffusion in C#](https://onnxruntime.ai/docs/tutorials/csharp/stable-diffusion-csharp.html)
202
103
203
104
## Reference
105
+
Special thanks to the creators of the fantastic repositories below; all were instrumental in the creation of OnnxStack.
106
+
107
+
[Stable Diffusion with C# and ONNX Runtime](https://github.com/cassiebreviu/stablediffusion) by Cassie Breviu (@cassiebreviu)
108
+
109
+
[Diffusers](https://github.com/huggingface/diffusers) by Huggingface (@huggingface)
204
110
205
-
This work is based on the original C# implementation of Stable Diffusion by Cassie Breviu here: [Stable Diffusion with C# and ONNX Runtime](https://github.com/cassiebreviu/stablediffusion).
111
+
[Onnx-Web](https://github.com/ssube/onnx-web) by Sean Sube (@ssube)
0 commit comments