Skip to main content

Stable Diffusion 1.5

The optimised base model of SD 1.5 designed to create high quality images for few preset options. You can achieve these results with basic prompt description


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

"prompt": "cat wizard, gandalf, lord of the rings, detailed, fantasy, cute, adorable, Pixar, Disney, 8k",
"style" : "realistic_portrait"
}
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.
stylestringDefault: realistic_portrait, fantasy_art, cartoon_anime
negative_promptstringCheck our Prompt Guide for tips.
model_idstringDefault: 0b397287-3449-4801-9a86-536465f6189f.
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: 512. Optional image height.
widthintegerMax: 1536. Default: 512. 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.
base64booleanIf base64 output is needed.
upscalestringTo upscale the image by 2x, set to 2x.
webhookstringGenerated image will be sent to this webhook.
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_sd15_light
- ip-adapter_sd15
- ip-adapter-plus_sd15
- ip-adapter-plus-face_sd15
ip_adapter_scalearray number[]Default: []. Adjust the text prompt and image prompt condition ratio.
hiresbooleanFixes small imperfections and upscales image.
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 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/v1/status/{{id}}

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