Stelath's picture
End of training
865795a verified
from handler import EndpointHandler
from PIL import Image
# init handler
my_handler = EndpointHandler(path=".")
# prepare sample payload
reg_payload = {"inputs": "An astronaut riding a horse on the moon, <comic-strip> style"}
neg_payload = {"inputs": "A strawberry on the beach, <comic-strip> style", "negative_prompt": "black and white"}
multi_payload = {"inputs": ["A strawberry on the beach, <comic-strip> style", "An astronaut riding a horse on the moon, <comic-strip> style"], "negative_prompt": "black and white"}
# test the handler
reg_payload_pred=my_handler(reg_payload)
neg_payload_pred=my_handler(neg_payload)
multi_payload_pred=my_handler(multi_payload)
reg_payload_pred[0].save("reg_payload_pred.png")
neg_payload_pred[0].save("neg_payload_pred.png")