TensorStack-AI / OnnxStack

C# Stable Diffusion using ONNX Runtime
Apache License 2.0
222 stars 33 forks source link

Image upscale pipeline #19

Closed saddam213 closed 1 year ago

saddam213 commented 1 year ago

Add a new pipeline for image up-scaling

Will be using the following model for development https://huggingface.co/ssube/stable-diffusion-x4-upscaler-onnx

saddam213 commented 1 year ago

Upon further investigation into implementation it seems the max sample size for upscale is 128

128 -> 512

For images over 128 we are going to have to split into tiles, upscale and reassemble

512 -> [128, 128, 128, 128] -> [512, 512, 512, 512] -> 2048

Amin456789 commented 1 year ago

there is an upscaler in onnx named SwinIR, which included some models in it like RealSR [best upscaler i ever used] it is a very small onnx model that can be found here: https://huggingface.co/rocca/swin-ir-onnx/tree/main it will be great if it be included as another model for ur upscaler

saddam213 commented 1 year ago

there is an upscaler in onnx named SwinIR, which included some models in it like RealSR [best upscaler i ever used] it is a very small onnx model that can be found here: https://huggingface.co/rocca/swin-ir-onnx/tree/main it will be great if it be included as another model for ur upscaler

Thanks for this link dude.

I have been trying for weeks to get a diffusion upscaler to work, but never got a good result I tried this one and it worked first time, plus you don't have to tile the images, I can just give it a 512 image and it spits out a 2048

However these type of upscalers do not work like diffusion ones, e.g no steps, prompt needed, so I need to think of a good way to add this to the codebase

I will add the x2 and x4 versions along with smaller ones like Face Upscalers etc

Amin456789 commented 1 year ago

u r welcome, thanks!

saddam213 commented 1 year ago

Closing PR, new implementation needed