Nodes/ComfyUI-Replicate/Replicate stability-ai/sdxl
ComfyUI Node

Replicate stability-ai/sdxl

Run SDXL (text-to-image, img2img, inpaint) via API

By replicate·Created 2 years ago·Updated 2 years ago· 206
Replicate stability-ai/sdxl
  • image
  • mask
  • IMAGE
promptAn astronaut riding a rainbow unicorn
negative_prompt
width1024
height1024
num_outputs1
schedulerK_EULER
num_inference_steps50
guidance_scale7.50
prompt_strength0.80
seed
refineno_refiner
high_noise_frac0.80
refine_steps
apply_watermarktrue
lora_scale0.60
replicate_weights
disable_safety_checkerfalse
force_rerunfalse

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 alongside image for 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:
    cd ComfyUI/custom_nodes
    git clone https://github.com/replicate/comfyui-replicate
    cd comfyui-replicate
    pip install -r requirements.txt
    
    then restart.

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.

CategoryReplicate

Inputs (20)

NameTypeDefaultDescription
promptoptSTRINGAn astronaut riding a rainbow unicorn
negative_promptoptSTRING
imageoptIMAGE
maskoptIMAGE
widthoptINT1024
heightoptINT1024
num_outputsoptINT11–4
scheduleroptCOMBOK_EULER7 options: DDIM, DPMSolverMultistep, HeunDiscrete, KarrasDPM, K_EULER_ANCESTRAL, K_EULER, +1
num_inference_stepsoptINT501–500
guidance_scaleoptFLOAT7.501–50
prompt_strengthoptFLOAT0.800–1
seedoptINT
refineoptCOMBOno_refiner3 options: no_refiner, expert_ensemble_refiner, base_image_refiner
high_noise_fracoptFLOAT0.800–1
refine_stepsoptINT
apply_watermarkoptBOOLEANtrue
lora_scaleoptFLOAT0.600–1
replicate_weightsoptSTRING
disable_safety_checkeroptBOOLEANfalse
force_rerunoptBOOLEANfalse

Outputs (1)

NameTypeDescription
IMAGEIMAGE