import gradio as gr # To convert your image file into the base64 format required by the API gr.processing_utils.encode_url_or_file_to_base64(path) # To convert the base64 image returned by the API to an image tmp file object gr.processing_utils.decode_base64_to_file(encoding, encryption_key=None, file_path=None)