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.
Test this model instantly in the Console Playground โ no code required
Copy usage instructions for Claude, ChatGPT, or other AI
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"
}
}'| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prompt | string | No | An astronaut riding a rainbow unicorn | Input prompt |
negative_prompt | string | No | - | What to avoid in the image |
image | string | No | - | Input image for img2img or inpainting |
mask | string | No | - | Inpainting mask โ white areas are repainted, black preserved |
width | integer | No | 1024 | Output width |
height | integer | No | 1024 | Output height |
num_outputs | integer | No | 1 | Number of images (1-4). Billed per image |
scheduler | string | No | K_EULER | scheduler DDIMDPMSolverMultistepHeunDiscreteKarrasDPMK_EULER_ANCESTRALK_EULERPNDM |
num_inference_steps | integer | No | 50 | Denoising steps (fewer is faster) |
guidance_scale | number | No | 7.5 | Classifier-free guidance scale |
prompt_strength | number | No | 0.8 | img2img/inpaint denoising strength. 1.0 fully replaces the input |
seed | integer | No | - | Random seed. Leave blank to randomize |
refine | string | No | no_refiner | Refine style: no_refiner, expert_ensemble_refiner, base_image_refiner no_refinerexpert_ensemble_refinerbase_image_refiner |
high_noise_frac | number | No | 0.8 | For expert_ensemble_refiner, the fraction of noise to use |
refine_steps | integer | No | - | For base_image_refiner, the number of steps to refine, defaults to num_inference_steps |
apply_watermark | boolean | No | true | 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. |
lora_scale | number | No | 0.6 | LoRA additive scale. Only applicable on trained models. |
replicate_weights | string | No | - | Replicate LoRA weights to use. Leave blank to use the default weights. |
disable_safety_checker | boolean | No | false | Disable 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) |
There are 3 ways to provide files for the imagemask parameters:
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"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"
}
}Common parameters used when calling POST /v1/predictions.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model identifier |
input | object | Yes | - | Object containing the model-specific parameters from the table above |
output_folder | string | No | - | Folder path for output files (max 256 chars, '..' not allowed) |
webhook_url | string | No | - | Webhook URL to call on completion |
is_public | boolean | No | false | If true, output files are also available via permanent public URLs |
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"
}
}'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
}
}'POST /v1/predictions