# Stable Diffusion XL - Core.Today AI API > 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. - **Provider**: Stability AI - **Model ID**: stability-ai/sdxl - **Category**: Image Generation - **Credits**: 9 per image (num_outputs billed per image) - **Speed**: Medium - **Quality**: High ## Features - Battle-tested classic (85M+ runs) - img2img and inpainting with mask - Expert-ensemble refiner support - LoRA weights loading - Up to 4 images per request ## Use Cases - General-purpose image generation - Inpainting and image editing - LoRA-based custom styles - Compatibility with SDXL ecosystem workflows - Cost-efficient production pipelines ## API Endpoint Base URL: https://api.core.today/v1 Create Prediction: POST /predictions Get Status: GET /predictions/{job_id} ## Authentication Header: X-API-Key: YOUR_API_KEY ## Input Parameters ### Optional - **prompt**: string (default: An astronaut riding a rainbow unicorn) - Input prompt - **negative_prompt**: string - What to avoid in the image - **image**: string - Input image for img2img or inpainting - **mask**: string - Inpainting mask — white areas are repainted, black preserved - **width**: integer (default: 1024) - Output width - **height**: integer (default: 1024) - Output height - **num_outputs**: integer (default: 1) - Number of images (1-4). Billed per image - **scheduler**: string (default: K_EULER) - scheduler Options: DDIM, DPMSolverMultistep, HeunDiscrete, KarrasDPM, K_EULER_ANCESTRAL, K_EULER, PNDM - **num_inference_steps**: integer (default: 50) - Denoising steps (fewer is faster) - **guidance_scale**: number (default: 7.5) - Classifier-free guidance scale - **prompt_strength**: number (default: 0.8) - img2img/inpaint denoising strength. 1.0 fully replaces the input - **seed**: integer - Random seed. Leave blank to randomize - **refine**: string (default: no_refiner) - Refine style: no_refiner, expert_ensemble_refiner, base_image_refiner Options: no_refiner, expert_ensemble_refiner, base_image_refiner - **high_noise_frac**: number (default: 0.8) - For expert_ensemble_refiner, the fraction of noise to use - **refine_steps**: integer - For base_image_refiner, the number of steps to refine, defaults to num_inference_steps - **apply_watermark**: boolean (default: 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 (default: 0.6) - LoRA additive scale. Only applicable on trained models. - **replicate_weights**: string - Replicate LoRA weights to use. Leave blank to use the default weights. - **disable_safety_checker**: boolean (default: 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) ## Examples ### Classic Text-to-Image Generate a 1024px image with the refiner ```json { "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 ```json { "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 } } ``` ## Response Format ```json { "job_id": "abc123", "status": "pending | processing | completed | failed", "result": "URL or data (when completed)" } ``` ## Usage Flow 1. POST /predictions with model and input -> receive job_id 2. GET /predictions/{job_id} -> poll until status is completed or failed 3. Result contains output URL(s) ## Tips - Use expert_ensemble_refiner for noticeably better detail on final renders - For inpainting, white mask areas are repainted and black areas preserved - Lower num_inference_steps (25-30) for faster drafts with minor quality loss - For instant drafts use SDXL Lightning; for frontier quality use FLUX or Seedream ## Documentation https://replicate.com/stability-ai/sdxl