Python, Artificial Intelligence, Serverless, Hugging Face, Local Gpt.
here is the magic: we open a stream object with open(input_image, "rb") as image_file: we encode it to base64 we decode it into utf-8 Now our image can be sent back, and the structured return object is a json containing the original prompt, the guidance scale, the strength and the encoded generated