It only takes a few lines (pasted from https://huggingface.co/spaces/akhaliq/Real-ESRGAN):
gr.Interface( inference, [gr.inputs.Image(type="pil", label="Input"),gr.inputs.Radio(["base","anime"], type="value", default="base", label="model type")], gr.outputs.Image(type="file", label="Output"), title=title, description=description, article=article, examples=[ ['bear.jpg','base'], ['anime.png','anime'] ]).launch()
It only takes a few lines (pasted from https://huggingface.co/spaces/akhaliq/Real-ESRGAN):