Skip to main content

Stable Diffusion 3.5

Text to image with Stable Diffusion 3.5


import requests
import json

url = "https://api.imagepipeline.io/sd3_5/v1"
headers = {
"API-Key": "Your API Key",
"Content-Type": "application/json"
}
data = {
"prompt": "beautiful waterfall in the rainforest, anime style",
"negative_prompt": "error, cropped, worst quality, low quality, duplicate, bad proportions, incomplete subject",
"num_inference_steps": 4,
"samples": 1,
"guidance_scale":0.0,
"width": 1024,
"height": 1024
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())

Available JSON Parameters for Control

ParameterTypeNotes
promptstringRequired. Description of the image to generate.
negative_promptstringRequired. Description of what should not appear in the image.
num_inference_stepsintegerRequired. Number of inference steps.
samplesintegerRequired. Max: 2. Number of images to generate.
guidance_scalenumberRequired. Max: 20. Controls how much the image should adhere to the prompt.
heightintegerDefault: 1024. Optional image height.
widthintegerDefault: 1024. Optional image width.
webhookstringGenerated image will be sent to this webhook.
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 the task 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 an 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: [GET]

  • https://api.imagepipeline.io/sd3_5/v1/status/{{id}}

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