ai-forever / Real-ESRGAN

PyTorch implementation of Real-ESRGAN model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Visual artefacts present in upscaled images when device is set to 'mps'

ericpesto opened this issue · comments

+1. I'm having the same problem. Did you find out how to solve it?

Found a solution when using mps:
Inside the folder RealESRGAN in the main.py, you must first call cpu() and then clamp.

Code in the repo line 77:
sr_image = res.permute((0,2,3,1)).clamp_(0, 1).cpu()

New code:
sr_image = res.permute((0,2,3,1)).cpu().clamp_(0,1)

Can confirm, works for me too, nice find!

*I had to make the change in models.py