diff --git a/Assets/Samples/1207582124_30_7.5_30_DDIM.png b/Assets/Samples/1207582124_30_7.5_30_DDIM.png new file mode 100644 index 00000000..e90d8e30 Binary files /dev/null and b/Assets/Samples/1207582124_30_7.5_30_DDIM.png differ diff --git a/Assets/Samples/1207582124_30_7.5_30_DDPM.png b/Assets/Samples/1207582124_30_7.5_30_DDPM.png new file mode 100644 index 00000000..d6e163f7 Binary files /dev/null and b/Assets/Samples/1207582124_30_7.5_30_DDPM.png differ diff --git a/Assets/Samples/1207582124_30_7.5_30_Euler.png b/Assets/Samples/1207582124_30_7.5_30_Euler.png new file mode 100644 index 00000000..49d9f0ad Binary files /dev/null and b/Assets/Samples/1207582124_30_7.5_30_Euler.png differ diff --git a/Assets/Samples/1207582124_30_7.5_30_EulerAncestral.png b/Assets/Samples/1207582124_30_7.5_30_EulerAncestral.png new file mode 100644 index 00000000..6c96e20b Binary files /dev/null and b/Assets/Samples/1207582124_30_7.5_30_EulerAncestral.png differ diff --git a/Assets/Samples/1207582124_30_7.5_30_KDPM2.png b/Assets/Samples/1207582124_30_7.5_30_KDPM2.png new file mode 100644 index 00000000..445a7bef Binary files /dev/null and b/Assets/Samples/1207582124_30_7.5_30_KDPM2.png differ diff --git a/Assets/Samples/1207582124_30_7.5_30_LMS.png b/Assets/Samples/1207582124_30_7.5_30_LMS.png new file mode 100644 index 00000000..3cfe771d Binary files /dev/null and b/Assets/Samples/1207582124_30_7.5_30_LMS.png differ diff --git a/OnnxStack.UI/README.md b/OnnxStack.UI/README.md new file mode 100644 index 00000000..9d81859f --- /dev/null +++ b/OnnxStack.UI/README.md @@ -0,0 +1,103 @@ +

+ +

+ + +![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/saddam213/OnnxStack) +[![Core Badge](https://img.shields.io/nuget/v/OnnxStack.Core?color=4bc51e&label=OnnxStack.Core)](https://www.nuget.org/packages/OnnxStack.Core) +![Nuget](https://img.shields.io/nuget/dt/OnnxStack.Core) +[![StableDiffusion Badge](https://img.shields.io/nuget/v/OnnxStack.StableDiffusion?color=4bc51e&label=OnnxStack.StableDiffusion)](https://www.nuget.org/packages/OnnxStack.StableDiffusion) +![Nuget](https://img.shields.io/nuget/dt/OnnxStack.StableDiffusion) + + + +### Welcome to OnnxStack WPF GUI! +This project is a sample WPF GUI of the OnnxStack library's Inference Stable Diffusion implementation. + +### **Prompt** + +Stable Diffusion models take a text prompt and create an image that represents the text. + +*Example:* +` +final fantasy style cyberpunk desert assassin girl with thigh-high boot +` + +### **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 `LMS Discrete`, `Euler`, `Euler Ancestral`, `DDPM`, `DDIM`, `KDPM2` options with more in the works. + +*Example:* +| LMS Scheduler | Euler Scheduler | Euler Ancestral Scheduler | DDPM Scheduler | DDIM Scheduler | KDPM2 Scheduler +| :--- | :--- | :--- | :--- | :--- | :--- | +Image of browser inferencing on sample images. | Image of browser inferencing on sample images. | Image of browser inferencing on sample images. | Image of browser inferencing on sample images. | Image of browser inferencing on sample images. | Image of browser inferencing on sample images. | + + Model: OpenJourney V4 Seed: 1207582124 GuidanceScale: 7.5 NumInferenceSteps: 30 Prompt: A cyberpunk puppy + +__________________________ + +# Getting Started + + +## 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](https://huggingface.co/models?sort=downloads&search=Stable+Diffusion). + +- [Stable Diffusion Models v1.4](https://huggingface.co/CompVis/stable-diffusion-v1-4/tree/onnx) +- [Stable Diffusion Models v1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/onnx) + + +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. + +Clone the model repo: +```text +git lfs install +git clone https://huggingface.co/runwayml/stable-diffusion-v1-5 -b onnx +``` + + +## Stable Diffusion Models We've Converted To ONNX And Tested +The following are othe stable diffusion models we've converted to ONNX and tested with OnnxStack. + +- [OpenJourney V4](https://huggingface.co/TheyCallMeHex/OpenJourney-V4-ONNX) +- [DreamLike PhotoReal 2.0](https://huggingface.co/TheyCallMeHex/DreamLike-PhotoReal-2.0-ONNX) +- [CyberPunk Anime Diffusion](https://huggingface.co/TheyCallMeHex/Cyberpunk-Anime-Diffusion-ONNX) +- [InkPunk Diffusion](https://huggingface.co/TheyCallMeHex/Inkpunk-Diffusion-ONNX) +- [Mo-Di Diffusion](https://huggingface.co/TheyCallMeHex/Mo-Di-Diffusion-ONNX) +- [epiCRealism](https://huggingface.co/TheyCallMeHex/epiCRealism-ONNX) +- [Comic Diffusion](https://huggingface.co/TheyCallMeHex/Comic-Diffusion-ONNX) +- [Redshift Diffusion](https://huggingface.co/TheyCallMeHex/Redshift-Diffusion-ONNX) + +## 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 + + + +## 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 +- [ONNX Runtime C# API Doc](https://onnxruntime.ai/docs/api/csharp/api) +- [Get Started with C# in ONNX Runtime](https://onnxruntime.ai/docs/get-started/with-csharp.html) +- [Hugging Face Stable Diffusion Blog](https://huggingface.co/blog/stable_diffusion) \ No newline at end of file diff --git a/README.md b/README.md index c5b6536a..03c7045e 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ painting, drawing, sketches, monochrome, grayscale, illustration, anime, cartoon ### **Schedulers** Many different scheduler algorithms can be used for this computation, each having its pro- and cons. -So far `OnnxStack.StableDiffusion` as included `LMS Discrete`, `Euler Ancestral`, and `DDPM`, and `DDIM` options with more in the works. +So far `OnnxStack.StableDiffusion` as included `LMS Discrete`, `Euler Ancestral`, `DDPM`, `DDIM`, and `KDPM2` options with more in the works. *Example:* | LMS Scheduler | Euler Ancestral Scheduler | DDPM Scheduler | @@ -132,6 +132,19 @@ git clone https://huggingface.co/runwayml/stable-diffusion-v1-5 -b onnx ``` +## Stable Diffusion Models We've Converted To ONNX And Tested +The following are othe stable diffusion models we've converted to ONNX and tested with OnnxStack. + +- [OpenJourney V4](https://huggingface.co/TheyCallMeHex/OpenJourney-V4-ONNX) +- [DreamLike PhotoReal 2.0](https://huggingface.co/TheyCallMeHex/DreamLike-PhotoReal-2.0-ONNX) +- [CyberPunk Anime Diffusion](https://huggingface.co/TheyCallMeHex/Cyberpunk-Anime-Diffusion-ONNX) +- [InkPunk Diffusion](https://huggingface.co/TheyCallMeHex/Inkpunk-Diffusion-ONNX) +- [Mo-Di Diffusion](https://huggingface.co/TheyCallMeHex/Mo-Di-Diffusion-ONNX) +- [epiCRealism](https://huggingface.co/TheyCallMeHex/epiCRealism-ONNX) +- [Comic Diffusion](https://huggingface.co/TheyCallMeHex/Comic-Diffusion-ONNX) +- [Redshift Diffusion](https://huggingface.co/TheyCallMeHex/Redshift-Diffusion-ONNX) + + ## Hardware Requirements You can choose between `Cpu` and `DirectML`(GPU) for inference, Other `Microsoft.ML.OnnxRuntime.*` executors like `Cuda` may work but are untested