Image creation with SDXL

Simply write a description of what you want, and doesn't want, wait for a few seconds and you'll get an awesome image, ready to share. SDXL is a text-to-image generative AI model developed by Stability AI that excels in creating visually appealing images.

Features

Text-to-Image Generation

To generate images using SDXL, simply provide a prompt and execute the model.

Image In-Painting

This lets you modify parts of an existing image with generated content. Simply provide an image with a mask and a prompt for the masked area. The mask has to a black-and-white image with the same shape as the input image. White pixels will be modified based on the prompt, while black pixels will be preserved.

Image-to-Image Generation

This functionality enables you to transform an image based on the prompt you enter. The prompt_strength parameter controls the strength of applying the prompt to the input image.

Use cases examples

  • - Create pictures for your social networks posts
  • - Add special objects on a photo
  • - Be inspired with interior designs
  • - Make fun images for your friends

Added by: APIForAI

Price per call≈ 0.04

License Paper Github

Try it nowAPI information

Try it

Examples

Input

{
"input":{
"prompt":"An orange cocktail with a stra..."
"negative_prompt":"bad quality"
"image":
"mask":
"width":1024
"height":1024
"num_outputs":1
"scheduler":"K_EULER"
"num_inference_steps":50
"guidance_scale":7.5
"prompt_strength":0.8
"seed":2986
"refine":"no_refiner"
"high_noise_frac":0.8
"refine_steps":50
"apply_watermark":true
"lora_scale":0.6
"disable_safety_checker":false
}
"id":75
}

Output

Image
{
"status":"succeeded"
"output":[
0:"https://rbqktisnztholqojxlaf.s..."
]
"prediction_time":11.955283
}

API Information

Input description

prompt string

Input prompt

Default value: An astronaut riding a rainbow unicorn

negative_prompt* string

Input Negative Prompt

image uri

Input image for img2img or inpaint mode

mask uri

Input mask for inpaint mode. Black areas will be preserved, white areas will be inpainted.

width integer

Width of output image

Default value: 1024

height integer

Height of output image

Default value: 1024

num_outputs integer

Number of images to output.

Default value: 1

scheduler string

The scheduler to use.

Default value: K_EULER

Enum values: DDIM, DPMSolverMultistep, HeunDiscrete, KarrasDPM, K_EULER_ANCESTRAL, K_EULER, PNDM

num_inference_steps integer

Number of denoising steps

Default value: 50

guidance_scale number

Scale for classifier-free guidance

Default value: 7.5

prompt_strength number

Prompt strength when using img2img / inpaint. 1.0 corresponds to full destruction of information in image

Default value: 0.8

seed integer

Random seed. Leave blank to randomize the seed

refine string

The refiner to use.

Default value: no_refiner

Enum values: no_refiner, expert_ensemble_refiner, base_image_refiner

high_noise_frac number

For expert_ensemble_refiner, the fraction of noise to use

Default value: 0.8

refine_steps* integer

For base_image_refiner, the number of steps to refine.

Default value: 50

apply_watermark boolean

Applies a watermark to enable determining if an image is generated in downstream applications. If you have other provisions for generating or deploying images safely, you can use this to disable watermarking.

Default value: true

lora_scale number

LoRA additive scale. Only applicable on trained models.

Default value: 0.6

disable_safety_checker boolean

Disable safety checker for generated images.

Output JSON Schema

This represents the JSON schema that details the structure of the model's output.

{
"type":"array"
"items":{
"type":"string"
"format":"uri"
}
"title":"Output"
}

APIForAI

Build fast by accessing AI models easily