Stable-Diffusion-Android icon indicating copy to clipboard operation
Stable-Diffusion-Android copied to clipboard

Upscale images using onnx models

Open Sosypans opened this issue 1 year ago • 7 comments

Recently, i have seen many app that started to use onnx models ( from openmodeldb.info ) to upscale images.

An i think It would be cool to add the ability to use onnx models, and be able to add custom models to upscale photos, as the other apps doesn't support adding custom models.

Sosypans avatar Nov 28 '24 10:11 Sosypans

Just curious, what apps? Could you give me a few names because I'm trying to find apps for upscaling images locally.

pr0grammed avatar Dec 28 '24 00:12 pr0grammed

Hey try super image pro app it let's u use upscaling models

KintCark avatar Dec 28 '24 00:12 KintCark

But does it run locally? I want something that's free.

pr0grammed avatar Dec 28 '24 22:12 pr0grammed

But does it run locally? I want something that's free.

https://github.com/tumuyan/RealSR-NCNN-Android This one actually uses NCNN models. But for Super image pro, yes it can run ONNX models locally, but you still need subscription. I have recently seen other multiple apps that can run ONNX locally but still can't load custom models.

Sosypans avatar Jan 03 '25 08:01 Sosypans

I'm already using that and it seems like it works the best for cartoon characters or images with a few colors because the models that work for me seem to make it sharper while getting rid of some details. And no, this doesn't only happen with the anime models. I even tried to add my own using the files found on the Huggingface but that failed.

pr0grammed avatar Jan 03 '25 21:01 pr0grammed

It is actually really easy to add custom models. https://openmodeldb.info/ This website provides a lot of models, you will be able to find NCNN, but most of the models are ONNX and Pytorch. So you will have to use Chainner (on pc) to convert them to NCNN, but be aware that ESRGAN, ESRGAN+ ,and Real-CUGAN are convertible.

After that you will need to create a folder in the custom directory you have chosen to load your custom models and rename this folder : "models-ESRGAN-NameOfTheModel" And then you gonna paste you bin and param files there. And also don't forget to rename your bin and param file to x4.bin , x4.param so it can detect the upscale value. Screenshot_20250106_092846_My Files And you are ready to go.

Sosypans avatar Jan 06 '25 07:01 Sosypans

I know about openmodeldb and I have used the models from there on my computer but I was using the models found on the huggingface by the creator at https://huggingface.co/tumuyan2/realsr-models and I was having issues with running those models even after following the instructions. But thanks for the extra information!

pr0grammed avatar Jan 11 '25 18:01 pr0grammed