OnnxStack.Core 0.1.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package OnnxStack.Core --version 0.1.0
NuGet\Install-Package OnnxStack.Core -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OnnxStack.Core" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OnnxStack.Core --version 0.1.0
#r "nuget: OnnxStack.Core, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OnnxStack.Core as a Cake Addin
#addin nuget:?package=OnnxStack.Core&version=0.1.0

// Install OnnxStack.Core as a Cake Tool
#tool nuget:?package=OnnxStack.Core&version=0.1.0

OnnxStack

ONNX Runtime Projects for .NET Applications

Hardware Requirements

You can choose between Cpu and DirectML(GPU) for inference, Other Microsoft.ML.OnnxRuntime.* executors like Cuda may work but are untested

Cpu > 12GB RAM

DirectML > 10GB VRAM

ONNX Model Download

You will need an ONNX compatible model to use, Hugging Face is a great place to download the Stable Diffusion models

Download the ONNX Stable Diffusion models from Hugging Face.

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 for more information.

Clone the model repo:

git lfs install
git clone https://huggingface.co/runwayml/stable-diffusion-v1-5 -b onnx

Projects

OnnxStack.StableDiffusion

Inference Stable Diffusion with C# and ONNX Runtime

Prompt

Stable Diffusion models take a text prompt and create an image that represents the text.

Example:

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

Negative Prompt

A negative prompt can be provided to guide the inference to exclude in calculations

Example:

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,

Schedulers

Many different scheduler algorithms can be used for this computation, each having its pro- and cons. So far OnnxStack.StableDiffusion as included LMSScheduler and EulerAncestralScheduler options with more in the works.

Example: | LMSScheduler | EulerAncestralScheduler| | :--- | :--- | <img src="https://i.imgur.com/osoEqGk.png" width="256" height="256" alt="Image of browser inferencing on sample images."/> | <img src="https://i.imgur.com/Xs30KgJ.png" width="256" height="256" alt="Image of browser inferencing on sample images."/> |

 Seed: 624461087     GuidanceScale: 8     NumInferenceSteps: 30

More information and Examples can be found in the OnnxStack.StableDiffusion project README



OnnxStack.ImageRecognition

Image recognition with ResNet50v2 with C# and ONNX Runtime

~WIP~



OnnxStack.ObjectDetection

Object detection with Faster RCNN Deep Learning with C# and ONNX Runtime

~WIP~


Contribution

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.


Resources

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on OnnxStack.Core:

Package Downloads
OnnxStack.StableDiffusion The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Stable Diffusion Integration Library for .NET Core This repository harnesses the capabilities of both ONNX Runtime and Microsoft ML, offering a comprehensive solution that empowers developers to build, deploy, and execute machine learning models seamlessly in .NET environments, unlocking a world of possibilities for intelligent applications.

OnnxStack.ImageUpscaler The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

OnnxRuntime Image Upscale Library for .NET Core

OnnxStack.FeatureExtractor The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

OnnxRuntime Image Feature Extractor Library for .NET Core

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on OnnxStack.Core:

Repository Stars
saddam213/OnnxStack
C# Stable Diffusion using ONNX Runtime
Version Downloads Last updated
0.31.0 169 4/25/2024
0.27.0 170 3/31/2024
0.25.0 164 3/14/2024
0.23.0 157 2/29/2024
0.22.0 121 2/23/2024
0.21.0 139 2/15/2024
0.19.0 142 2/1/2024
0.17.0 168 1/18/2024
0.16.0 119 1/11/2024
0.15.0 184 1/5/2024
0.14.0 140 12/27/2023
0.13.0 124 12/22/2023
0.12.0 128 12/15/2023
0.10.0 160 11/30/2023
0.9.0 132 11/23/2023
0.8.0 181 11/16/2023
0.7.0 135 11/9/2023
0.6.0 115 11/2/2023
0.5.0 128 10/27/2023
0.4.0 110 10/19/2023
0.3.1 132 10/9/2023
0.3.0 108 10/9/2023
0.2.0 112 10/3/2023
0.1.0 154 9/25/2023