Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit ae6ab89

Browse files
committed
Update main README
1 parent 3f956c9 commit ae6ab89

File tree

1 file changed

+42
-136
lines changed

1 file changed

+42
-136
lines changed

README.md

Lines changed: 42 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -3,127 +3,74 @@
33
</p>
44

55

6-
7-
[![Core Badge](https://img.shields.io/nuget/v/OnnxStack.Core?color=4bc51e&label=OnnxStack.Core)](https://www.nuget.org/packages/OnnxStack.Core)
8-
![Nuget](https://img.shields.io/nuget/dt/OnnxStack.Core)
9-
[![StableDiffusion Badge](https://img.shields.io/nuget/v/OnnxStack.StableDiffusion?color=4bc51e&label=OnnxStack.StableDiffusion)](https://www.nuget.org/packages/OnnxStack.StableDiffusion)
10-
![Nuget](https://img.shields.io/nuget/dt/OnnxStack.StableDiffusion)
11-
[![StableDiffusion Badge](https://img.shields.io/nuget/v/OnnxStack.StableDiffusion?color=4bc51e&label=OnnxStack.UI)](https://github.com/saddam213/OnnxStack/releases)
12-
![Nuget](https://img.shields.io/github/downloads/saddam213/OnnxStack/total)
13-
14-
156
![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/saddam213/OnnxStack)
167
[![Discord](https://img.shields.io/discord/1170119641545314375?label=Discord&)](https://discord.gg/YmUpFaaFsf)
178
[![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCaWjlIC2uz8hDIZCBXjyDRw)](https://www.youtube.com/@OnnxStack)
9+
### **[Discord](https://discord.gg/YxbQfbegdS)** | **[Youtube](https://www.youtube.com/@OnnxStack)**
10+
__________________________
1811

1912

2013

2114

22-
23-
### Welcome to OnnxStack!
15+
# Welcome to OnnxStack!
2416
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
2517
Welcome to Python-free AI integration with OnnxStack!
2618

2719

28-
## **Latest Release Download: [OnnxStack UI v0.10.0](https://github.com/saddam213/OnnxStack/releases/download/v0.10.0/WindowsUI.v0.10.0.zip)**
2920

30-
### **[Discord](https://discord.gg/YxbQfbegdS)** | **[Youtube](https://www.youtube.com/@OnnxStack)**
3121

3222
# Projects
3323

34-
## **[OnnxStack.StableDiffusion](OnnxStack.StableDiffusion/README.md)**
35-
Inference Stable Diffusion with C# and ONNX Runtime
36-
37-
### **Prompt**
38-
39-
Stable Diffusion models take a text prompt and create an image that represents the text.
40-
41-
*Example:*
42-
`
43-
High-fashion photography in an abandoned industrial warehouse, with dramatic lighting and edgy outfits, detailed clothing, intricate clothing, seductive pose, action pose, motion, beautiful digital artwork, atmospheric, warm sunlight, photography, neo noir, bokeh, beautiful dramatic lighting, shallow depth of field, photorealism, volumetric lighting, Ultra HD, raytracing, studio quality, octane render
44-
`
24+
## **[OnnxStack.Core](OnnxStack.Core/README.md)**
25+
**Model Inference with C# and ONNX Runtime**
4526

46-
### **Negative Prompt**
47-
48-
A negative prompt can be provided to guide the inference to exclude in calculations
49-
50-
*Example:*
51-
52-
`
53-
painting, drawing, sketches, monochrome, grayscale, illustration, anime, cartoon, graphic, text, crayon, graphite, abstract, easynegative, low quality, normal quality, worst quality, lowres, close up, cropped, out of frame, jpeg artifacts, duplicate, morbid, mutilated, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, glitch, deformed, mutated, cross-eyed, ugly, dehydrated, bad anatomy, bad proportions, gross proportions, cloned face, disfigured, malformed limbs, missing arms, missing legs fused fingers, too many fingers,extra fingers, extra limbs,, extra arms, extra legs,disfigured,
54-
`
55-
56-
### **Schedulers**
57-
58-
Many different scheduler algorithms can be used for this computation, each having its pro- and cons.
59-
So far `OnnxStack.StableDiffusion` as included `LMS Discrete`, `Euler Ancestral`, `DDPM`, `DDIM`, and `KDPM2` options with more in the works.
60-
61-
*Example:*
62-
| LMS Scheduler | Euler Ancestral Scheduler | DDPM Scheduler |
63-
| :--- | :--- | :--- |
64-
<img src="Assets/Samples/624461087_22_8_LMSScheduler.png" width="256" alt="Image of browser inferencing on sample images."/> | <img src="Assets/Samples/624461087_22_8_EulerAncestralScheduler.png" width="256" alt="Image of browser inferencing on sample images."/> |<img src="Assets/Samples/624461087_22_8_DDPMScheduler.png" width="256" alt="Image of browser inferencing on sample images."/> |
65-
66-
Seed: 624461087 GuidanceScale: 8 NumInferenceSteps: 22
67-
68-
### **Text To Image**
69-
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-
<img src="Assets/Samples/Text2Img_Start.png" width="256" alt="Image of browser inferencing on sample images."/> | <img src="Assets/Samples/Text2Img_End.png" width="256" alt="Image of browser inferencing on sample images."/> |<img src="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-
<img src="Assets/Samples/Img2Img_Start.bmp" width="256" alt="Image of browser inferencing on sample images."/> | <img src="Assets/Samples/Img2Img_End.png" width="256" alt="Image of browser inferencing on sample images."/> |<img src="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
84-
```
27+
[![Core Badge](https://img.shields.io/nuget/v/OnnxStack.Core?color=4bc51e&label=OnnxStack.Core)](https://www.nuget.org/packages/OnnxStack.Core)
28+
![Nuget](https://img.shields.io/nuget/dt/OnnxStack.Core)
8529

86-
### **Image Inpainting**
87-
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.
8831

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)**
9133

92-
| Input Image | Mask Image | Masked Image | Result
93-
| :--- | :--- | :--- | :--- |
94-
<img src="Assets/Samples/Inpaint-Original.png" width="256" alt="Image of browser inferencing on sample images."/> | <img src="Assets/Samples/Inpaint-Mask.png" width="256" alt="Image of browser inferencing on sample images."/> |<img src="Assets/Samples/Inpaint-MaskedImage.PNG" width="256" alt="Image of browser inferencing on sample images."/> |<img src="Assets/Samples/Inpaint-Result.png" width="256" alt="Image of browser inferencing on sample images."/> |
34+
__________________________
9535

96-
```
97-
Prompt: Rider on horse
98-
```
36+
__________________________
9937

10038

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.
39+
## **[OnnxStack.StableDiffusion](OnnxStack.StableDiffusion/README.md)**
40+
**Stable Diffusion Inference with C# and ONNX Runtime**
10341

104-
Performance will depend on hardware and models selected, but for `Latent Consistency Models` you can get up to 4fps with a 3090 :)
42+
[![StableDiffusion Badge](https://img.shields.io/nuget/v/OnnxStack.StableDiffusion?color=4bc51e&label=OnnxStack.StableDiffusion)](https://www.nuget.org/packages/OnnxStack.StableDiffusion)
43+
![Nuget](https://img.shields.io/nuget/dt/OnnxStack.StableDiffusion)
10544

106-
### Text To Image
107-
https://user-images.githubusercontent.com/4353684/285347887-99db7f37-cff4-48b6-805b-3ca55e8f0c3a.mp4
45+
`OnnxStack.StableDiffusion` is a .NET library for latent diffusion in C#, Leveraging `OnnxStack.Core`, this library seamlessly integrates many StableDiffusion capabilities, including
46+
* Text to Image
47+
* Image to Image
48+
* Image Inpaint
10849

109-
### Image To Image
110-
https://user-images.githubusercontent.com/4353684/285348410-c19a2111-6745-4f01-8400-d137d40180fe.mp4
50+
`OnnxStack.StableDiffusion` provides compatibility with a diverse set of models, including
51+
* StableDiffusion 1.5
52+
* SDXL
53+
* SDXL-Turbo
54+
* LatentConsistency
55+
* LatentConsistency XL
56+
* Instaflow
11157

112-
### Image Inpaint
113-
https://user-images.githubusercontent.com/4353684/285347894-9d044d7d-7c22-4379-8187-9cf7b9cac89c.mp4
11458

115-
### Paint To Image
116-
https://user-images.githubusercontent.com/4353684/285347896-8da6709b-fea6-4cd4-ba65-ec692401f475.mp4
59+
More information and Examples can be found in the `OnnxStack.StableDiffusion` project **[README](OnnxStack.StableDiffusion/README.md)**
11760

118-
https://user-images.githubusercontent.com/4353684/285547207-3a7ea067-fcbf-47f0-9372-fafa94d301f7.mp4
61+
__________________________
62+
__________________________
63+
## **[OnnxStack.ImageUpscaler]()**
64+
**Image upscaler with C# and ONNX Runtime**
11965

66+
[![Upscale Badge](https://img.shields.io/nuget/v/OnnxStack.ImageUpscaler?color=4bc51e&label=OnnxStack.ImageUpscaler)](https://www.nuget.org/packages/OnnxStack.ImageUpscaler)
67+
![Nuget](https://img.shields.io/nuget/dt/OnnxStack.ImageUpscaler)
12068

69+
`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.
12170

122-
More information and Examples can be found in the `OnnxStack.StableDiffusion` project **[README](OnnxStack.StableDiffusion/README.md)**
12371

72+
More information and Examples can be found in the `OnnxStack.ImageUpscaler` project **[README](OnnxStack.ImageUpscaler/README.md)**
12473
__________________________
125-
126-
12774
__________________________
12875
## **[OnnxStack.ImageRecognition]()**
12976
**Image recognition with ResNet50v2 and ONNX Runtime**
@@ -145,61 +92,20 @@ Enable robust object detection in your applications using RCNN (Region-based Con
14592
__________________________
14693

14794

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).
155-
156-
- [Stable Diffusion Models v1.4](https://huggingface.co/CompVis/stable-diffusion-v1-4/tree/onnx)
157-
- [Stable Diffusion Models v1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/onnx)
158-
159-
160-
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.
161-
162-
Clone the model repo:
163-
```text
164-
git lfs install
165-
git clone https://huggingface.co/runwayml/stable-diffusion-v1-5 -b onnx
166-
```
167-
168-
169-
## Stable Diffusion Models We've Converted To ONNX And Tested
170-
The following are othe stable diffusion models we've converted to ONNX and tested with OnnxStack.
171-
172-
- [OpenJourney V4](https://huggingface.co/TheyCallMeHex/OpenJourney-V4-ONNX)
173-
- [DreamLike PhotoReal 2.0](https://huggingface.co/TheyCallMeHex/DreamLike-PhotoReal-2.0-ONNX)
174-
- [CyberPunk Anime Diffusion](https://huggingface.co/TheyCallMeHex/Cyberpunk-Anime-Diffusion-ONNX)
175-
- [InkPunk Diffusion](https://huggingface.co/TheyCallMeHex/Inkpunk-Diffusion-ONNX)
176-
- [Mo-Di Diffusion](https://huggingface.co/TheyCallMeHex/Mo-Di-Diffusion-ONNX)
177-
- [epiCRealism](https://huggingface.co/TheyCallMeHex/epiCRealism-ONNX)
178-
- [Comic Diffusion](https://huggingface.co/TheyCallMeHex/Comic-Diffusion-ONNX)
179-
- [Redshift Diffusion](https://huggingface.co/TheyCallMeHex/Redshift-Diffusion-ONNX)
180-
181-
182-
## Hardware Requirements
183-
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-
19095
## Contribution
19196

19297
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.
19398

194-
195-
19699
__________________________
197-
## Resources
100+
## ONNX Runtime Resources
198101
- [ONNX Runtime C# API Doc](https://onnxruntime.ai/docs/api/csharp/api)
199102
- [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)
202103

203104
## 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)
204110

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

Comments
 (0)