import gradio as gr from prodiapy import Prodia from PIL import Image from io import BytesIO import requests import base64 client = Prodia() def run_face_swap(source_image, target_image): if source_image is None or target_image is None: return print(source_image, target_image) return "https://images.prodia.xyz/acfe8b01-b706-46d9-8c2d-287466337609.png" def image_to_base64(image: Image): # Convert the image to bytes buffered = BytesIO() image.save(buffered, format="PNG") # You can change format to PNG if needed # Encode the bytes to base64 img_str = base64.b64encode(buffered.getvalue()) return img_str.decode('utf-8') # Convert bytes to string with gr.Blocks() as demo: with gr.Column(): gr.HTML("