Learn how to deploy a Serverless endpoint running SDXL from the Runpod Hub and use it to generate images.
curl
.jq
command-line JSON processor (optional but recommended).32vgrms732dkwi
). Your endpoint URL will follow this pattern: https://api.runpod.ai/v2/ENDPOINT_ID/run
for asynchronous requests.
/run
endpoint to submit an asynchronous job that will generate an image based on your text prompt.
Replace ENDPOINT_ID
with your actual endpoint ID and YOUR_API_KEY
with your Runpod API key in the following command:
/status
endpoint with the job ID you received in the previous step.
Use the following command to check your job’s progress, replacing the placeholders (ENDPOINT_ID
, JOB_ID
, and YOUR_API_KEY
) with your actual values:
delayTime
field shows how long the job waited in the queue before processing began, measured in milliseconds.
COMPLETED
. Once your job completes, the status endpoint will return the generated image data encoded in base64 format.
When your job finishes successfully, you’ll receive a response containing the output:
executionTime
field shows how long the actual image generation took, while delayTime
indicates the initial queue wait time. Both values are in milliseconds.
To save the complete response for processing, use this command:
decode_image.py
to decode the base64 image data from your JSON response:
/runsync
endpoint for faster responses.