You can use cURL or any other http client to run inferences:
curl -X POST \
-H "Authorization: bearer $DEEPINFRA_TOKEN" \
-F 'prompt=A photo of an astronaut riding a horse on Mars.' \
'https://api.deepinfra.com/v1/inference/stabilityai/stable-diffusion-2-1'
which will give you back something similar to:
{
"images": [
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12PQz3wAAAJDAXkkWn+MAAAAAElFTkSuQmCC"
],
"nsfw_content_detected": [
false
],
"seed": 42,
"request_id": null,
"inference_status": {
"status": "unknown",
"runtime_ms": 0,
"cost": 0.0,
"tokens_generated": 0,
"tokens_input": 0
}
}
num_inference_steps
integernumber of denoising steps
Default value: 25
Range: 1 ≤ num_inference_steps ≤ 512
guidance_scale
numberclassifier-free guidance, higher means follow prompt more closely
Default value: 7.5
Range: 1 ≤ guidance_scale ≤ 20
strength
numberhow much to follow the input image. 1 means ignore the image, 0 means follow the image exactly
Default value: 0.8
Range: 0 ≤ strength ≤ 1
width
integerimage width in px
Default value: 768
Allowed values: 128
256
384
448
512
576
640
704
768
832
896
960
1024
height
integerimage height in px
Default value: 768
Allowed values: 128
256
384
448
512
576
640
704
768
832
896
960
1024
webhook
fileThe webhook to call when inference is done, by default you will get the output in the response of your inference request