import gradio as gr from gradio_client import Client sdxl_client = Client("https://fffiloni-sdxl-dpo.hf.space/") faceswap_client = Client("https://tonyassi-face-swap.hf.space/") def infer(portrait_in, prompt_in): # Generate Image from SDXL gr.Info("Generating SDXL image first ...") sdxl_result = sdxl_client.predict( prompt_in, api_name="/infer" ) # Face Swap gr.Info("Face swap your face on result ...") faceswap_result = faceswap_client.predict( portrait_in, sdxl_result, api_name="/predict" ) return faceswap_result css = """ #col-container{ margin: 0 auto; max-width: 840px; } """ with gr.Blocks(css=css) as demo: with gr.Column(elem_id="col-container"): gr.HTML("""