chaiNNer-org / spandrel

Spandrel gives your project support for various PyTorch architectures meant for AI Super-Resolution, restoration, and inpainting. Based on the model support implemented in chaiNNer.
MIT License
105 stars 7 forks source link

Extremely slow and using lots of memory #160

Open Tenpi opened 4 months ago

Tenpi commented 4 months ago

I was using some code adapted from https://github.com/joeyballentine/ESRGAN and then I tried to use this library for other architectures, but it performs at least 2-3x slower on the same models.

I don't know whether this library doesn't support mps and is falling back to cpu, or does more calculations that really slow it down. I ended up using the original code for ESRGAN models and this library for the others. For reference my code is at https://github.com/Tenpi/waifu2x/blob/master/scripts/upscale.py

It also uses up a ton of memory and I get an error upscaling anything above around 500x500px. The original code seems to handle larger images around 1000x1000px.

joeyballentine commented 4 months ago

That definitely seems like a bug. I don't think we're really doing anything different that could be causing that, but we'll look into it, thanks