Skip to main content
Core.Today
|
Stability AIMediumHigh

Stable Diffusion XL

Stability AI's classic SDXL (85M+ runs) โ€” the battle-tested text-to-image model with img2img, inpainting, refiner, and LoRA support. A dependable workhorse with a huge ecosystem.

9 credits
per image (num_outputs billed per image)
Battle-tested classic (85M+ runs)
img2img and inpainting with mask
Expert-ensemble refiner support
LoRA weights loading
Up to 4 images per request

Run it right now

Test this model instantly in the Console Playground โ€” no code required

Sign in to try

Use with AI Assistant

Copy usage instructions for Claude, ChatGPT, or other AI

Quick Start

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "stability-ai/sdxl",
  "input": {
    "prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
    "width": 1024,
    "height": 1024,
    "refine": "expert_ensemble_refiner"
  }
}'

Parameters

ParameterTypeRequiredDefaultDescription
promptstringNoAn astronaut riding a rainbow unicornInput prompt
negative_promptstringNo-What to avoid in the image
imagestringNo-Input image for img2img or inpainting
maskstringNo-Inpainting mask โ€” white areas are repainted, black preserved
widthintegerNo1024Output width
heightintegerNo1024Output height
num_outputsintegerNo1Number of images (1-4). Billed per image
schedulerstringNoK_EULERscheduler
DDIMDPMSolverMultistepHeunDiscreteKarrasDPMK_EULER_ANCESTRALK_EULERPNDM
num_inference_stepsintegerNo50Denoising steps (fewer is faster)
guidance_scalenumberNo7.5Classifier-free guidance scale
prompt_strengthnumberNo0.8img2img/inpaint denoising strength. 1.0 fully replaces the input
seedintegerNo-Random seed. Leave blank to randomize
refinestringNono_refinerRefine style: no_refiner, expert_ensemble_refiner, base_image_refiner
no_refinerexpert_ensemble_refinerbase_image_refiner
high_noise_fracnumberNo0.8For expert_ensemble_refiner, the fraction of noise to use
refine_stepsintegerNo-For base_image_refiner, the number of steps to refine, defaults to num_inference_steps
apply_watermarkbooleanNotrueApplies 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.
lora_scalenumberNo0.6LoRA additive scale. Only applicable on trained models.
replicate_weightsstringNo-Replicate LoRA weights to use. Leave blank to use the default weights.
disable_safety_checkerbooleanNofalseDisable safety checker for generated images. This feature is only available through the API. See [https://replicate.com/docs/how-does-replicate-work#safety](https://replicate.com/docs/how-does-replicate-work#safety)

How to Provide File Input

There are 3 ways to provide files for the imagemask parameters:

Recommended

Direct Upload (Multipart)

Attach files directly to POST /v1/predictions/upload. No separate upload step needed.

curl -X POST "https://api.core.today/v1/predictions/upload" \
  -H "X-API-Key: cdt_your_api_key" \
  -F "model=stability-ai/sdxl" \
  -F 'input={"prompt":"your prompt here"}' \
  -F "file:image=@your_file.png"

Image URL

Pass a publicly accessible URL directly. You can also use file_url from the Storage API.

{
  "model": "stability-ai/sdxl",
  "input": {
    "prompt": "your prompt here",
    "image": "https://example.com/image.jpg"
  }
}
See the File Upload docs for more upload methods including Presigned URLs.

Common Parameters

Common parameters used when calling POST /v1/predictions.

ParameterTypeRequiredDefaultDescription
modelstringYes-Model identifier
inputobjectYes-Object containing the model-specific parameters from the table above
output_folderstringNo-Folder path for output files (max 256 chars, '..' not allowed)
webhook_urlstringNo-Webhook URL to call on completion
is_publicbooleanNofalseIf true, output files are also available via permanent public URLs

Examples

Classic Text-to-Image

Generate a 1024px image with the refiner

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "stability-ai/sdxl",
  "input": {
    "prompt": "An astronaut riding a rainbow unicorn, cinematic, dramatic",
    "width": 1024,
    "height": 1024,
    "refine": "expert_ensemble_refiner"
  }
}'

Inpainting

Repaint the masked region of an image

curl -X POST "https://api.core.today/v1/predictions" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: cdt_your_api_key" \
  -d '{
  "model": "stability-ai/sdxl",
  "input": {
    "prompt": "A golden retriever sitting on a bench",
    "image": "https://example.com/photo.png",
    "mask": "https://example.com/mask.png",
    "prompt_strength": 0.9
  }
}'

Tips & Best Practices

1Use expert_ensemble_refiner for noticeably better detail on final renders
2For inpainting, white mask areas are repainted and black areas preserved
3Lower num_inference_steps (25-30) for faster drafts with minor quality loss
4For instant drafts use SDXL Lightning; for frontier quality use FLUX or Seedream

Use Cases

General-purpose image generation
Inpainting and image editing
LoRA-based custom styles
Compatibility with SDXL ecosystem workflows
Cost-efficient production pipelines