import gradio as gr from PIL import Image def add_watermark(image): image = Image.fromarray(np.uint8(image)) watermark = Image.open("watermark.png") image = image.convert("RGBA") watermark = watermark.convert("RGBA") width = image.width() height = image.height() image.paste(watermark, (width, height), watermark) return image gr.Interface(fn=add_watermark, inputs="image", outputs="image", title="Add watermark", examples = ["example.jpg"] ).launch();