Replicate stability-ai/sdxl
Run SDXL (text-to-image, img2img, inpaint) via API
- image
- mask
- IMAGE
This runs SDXL 1.0 - Stability's 2023 1024px base model - through Replicate's cloud, covering text-to-image, img2img, and inpainting in one node. The reason to use it this way is convenience: no checkpoint to download, no VRAM budget, works on any machine. The reason to think twice is honesty about what SDXL base is. The base model was deliberately unremarkable; the whole SDXL story is that the fine-tunes (Juggernaut, RealVis, Pony, Illustrious) are the actual product. This node gives you the plain base, so expect competent-but-bland unless you supply your own weights.
Standard Replicate setup applies: your inputs go to Replicate, the model runs on their GPU, the image comes back. You need a Replicate account and a REPLICATE_API_TOKEN, and you pay per run.
How it works
SDXL is a latent diffusion model with two text encoders and a native 1024×1024 resolution. Unlike the Flux tiers in this same pack, it has real CFG - so negative prompts work here, which is a genuine reason to reach for SDXL over Flux when you need to say "not that." It shipped with a two-stage base+refiner design that the community mostly ignored; the refine option exposes it if you want it.
The inputs and outputs that matter
prompt/negative_prompt- SDXL responds to both tags and short prose, and the negative actually does something.image+prompt_strength(0.8) - supply an image to switch into img2img; prompt_strength sets how far it departs from it.mask- add a mask alongsideimagefor inpainting.width/height(1024) - stick near trained ratios; wildly off-ratio sizes stretch anatomy.num_inference_steps(50),guidance_scale(7.5),scheduler(K_EULER) - the usual sampler controls.
Output is a single IMAGE. Worth flagging: apply_watermark defaults to true (an invisible watermark) - turn it off if you don't want it. refine picks a refiner mode, replicate_weights loads a trained LoRA/checkpoint URL, lora_scale weights it, num_outputs batches, seed fixes the result, disable_safety_checker drops the filter, and force_rerun skips Replicate's cache.
How to install it
One install brings every Replicate node.
- ComfyUI Manager: search ComfyUI-Replicate, install, restart.
- Manual:
then restart.cd ComfyUI/custom_nodes git clone https://github.com/replicate/comfyui-replicate cd comfyui-replicate pip install -r requirements.txt
No weights land on disk - just the replicate pip package. Set your token first: export REPLICATE_API_TOKEN="r8_..." (replicate.com/account/api-tokens).
Common issues & troubleshooting
The output looks flat and generic. That's base SDXL, not a mistake. The base was bland by design and the community's answer was always fine-tuned checkpoints. Point replicate_weights at a trained model, or if you're on a local ComfyUI anyway, honestly you may be better off loading a real checkpoint (Juggernaut, RealVisXL) natively than calling the plain base through an API.
There's a faint watermark in my image. apply_watermark is on by default. Set it to false.
Anatomy is stretched or duplicated. You probably generated at an off-ratio size. Keep width/height at or near SDXL's trained ratios (1024×1024, 1152×896, 1216×832 and rotations), then upscale rather than generating huge in one pass.
Same image on a re-run. Replicate returned the cached result for identical inputs. Change the seed or set force_rerun.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| promptopt | STRING | An astronaut riding a rainbow unicorn | — |
| negative_promptopt | STRING | — | |
| imageopt | IMAGE | — | |
| maskopt | IMAGE | — | |
| widthopt | INT | 1024 | — |
| heightopt | INT | 1024 | — |
| num_outputsopt | INT | 11–4 | — |
| scheduleropt | COMBO | K_EULER | 7 options: DDIM, DPMSolverMultistep, HeunDiscrete, KarrasDPM, K_EULER_ANCESTRAL, K_EULER, +1 |
| num_inference_stepsopt | INT | 501–500 | — |
| guidance_scaleopt | FLOAT | 7.501–50 | — |
| prompt_strengthopt | FLOAT | 0.800–1 | — |
| seedopt | INT | — | |
| refineopt | COMBO | no_refiner | 3 options: no_refiner, expert_ensemble_refiner, base_image_refiner |
| high_noise_fracopt | FLOAT | 0.800–1 | — |
| refine_stepsopt | INT | — | |
| apply_watermarkopt | BOOLEAN | true | — |
| lora_scaleopt | FLOAT | 0.600–1 | — |
| replicate_weightsopt | STRING | — | |
| disable_safety_checkeropt | BOOLEAN | false | — |
| force_rerunopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |