import os os.system("pip install gradio==2.4.6") import gradio as gr from PIL import Image import torch def greet(num): return num+69 iface = gr.Interface(fn=greet, inputs="number", outputs="number") iface.launch(share=True) def inference(img): out = face2paint(model1, img) return out title = "Pivotal Tuning for Latent Based Real Image Editing" description = "Gradio Demo for Pivotal Tuning Inversion. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below. Please use a cropped portrait picture for best results similar to the examples below." article = "

Github Repo Pytorch" gr.Interface(inference, [gr.inputs.Image(type="pil")], gr.outputs.Image(type="pil"),title=title,description=description,article=article,allow_flagging=False,allow_screenshot=False,enable_queue=True).launch(share=True)