Skip to main content

Stable Diffusion XL

The optimised base model of SDXL designed to create high quality images with a simple prompt description


import requests
import json
url = "https://api.imagepipeline.io/generate/v2"
headers = {
"API-Key": "Your API Key"
}
data = {

"prompt": "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k"

}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())

Available JSON Parameters for Control

ParameterPermissible valuesNotes
promptstringRequired. Check our Prompt Guide for tips.
negative_promptstringRequired. Check our Prompt Guide for tips.
model_idstringDefault: 6b760847-792b-46c0-a7f3-a53f952d6836.
num_inference_stepsintegerDefault: 20. Integer numbers. Ideal value: 20-30.
samplesintegerMax: 4. Default: 1. Generates a maximum of 4 samples per API call.
clip_skipintegerMax: 12. Integer numbers.
strengthnumberMax: 1. Default: 0.8. Optional denoise strength.
guidance_scalenumberMax: 20. Default: 7.5. Higher guidance scale prioritizes text prompt relevance.
heightintegerMax: 1536. Default: 1024. Optional image height.
widthintegerMax: 1536. Default: 1024. Optional image width.
lora_modelsarray string[]Default: []. Optional LoRa models (comma separated).
lora_weightsarray number[]Default: []. Optional LoRa weights (comma separated).
embeddingsarray string[]Default: []. Optional embeddings (comma separated).
seedintegerDefault: -1. Controlling the seed can help generate reproducible images.
safety_checkerbooleanChecks for NSFW images and filters explicit images.
webhookstringGenerated image will be sent to this webhook.
base64booleanIf base64 output is needed.
server_idstringOptional server_id to use enterprise subscription. Load-balance with any or specific id.
schedulerallOfChoose an appropriate scheduler. Valid values:
- EulerDiscreteScheduler
- DDIMScheduler
- DDPMScheduler
- HeunDiscreteScheduler
- UniPCMultistepScheduler
- DPMSolverMultistepScheduler
- DEISMultistepScheduler
- PNDMScheduler
- EulerAncestralDiscreteScheduler
- KDPM2DiscreteScheduler
- LCMScheduler
- DPMSolverMultistepSchedulerSDE
ip_adapter_style_imagesarray string[]Default: []. Reference images for multi-ip-adapter.
ip_adapter_imagestringReference image for ip-adapter.
ip_adapterarray string[]Default: []. Valid values:
- ip-adapter_sdxl
- ip-adapter_sdxl_vit-h
- ip-adapter-plus_sdxl_vit-h
- ip-adapter-plus-face_sdxl_vit-h
ip_adapter_scalearray number[]Default: []. Adjust the text prompt and image prompt condition ratio.
hiresbooleanFixes small imperfections.
hidiffusionbooleanApplies hidiffusion.
direct_linkbooleanFetches the friendly URL in PNG format.
batch_idstringAdds a batch_id.
file_prefixstringAdds a file_prefix.
queued_image_urlsbooleanReturns the links of the images prematurely. The link will have the image once generation is completed.

Status

Your response will include a status.

  • If the status = SUCCESS, you will also have download_urls that will have the links to your generated image based on the number of samples you have entered. The maximum number of samples that can be generated is 4.
  • If the status = PENDING, you will receive a id. You can use the status endpoint to fetch your image using the id.
  • If the status = FAILURE, you will receive only an error message.

Endpoint:

  • https://api.imagepipeline.io/generate/v2/status/{{id}}

Pass the API-Key as the authorization in the header.