Text-to-Image Generation
SDXL generates images from text prompts. Unlike other generative image models, SDXL is optimized to generate complex compositions with high aesthetic quality even with simple prompts. Prompt engineering for SDXL is significantly easier than in other image models, so there is no need for excess descriptors such as 'high quality.' Sdxl nsfw supports various input parameters including cfg_scale (guidance scale controlling randomness, recommended between 5 and 15 with default 7), height and width (native generation at 1024x1024 with optimal aspect ratios including 1152x896, 896x1152, 1216x832, 832x1216, 1344x768, 768x1344, 1536x640, and 640x1536), steps (number of generation steps, with 50 as a good default), seed (for deterministic generation), and sampler (different sampling methods with K_DPMPP_2M as the recommended baseline). The model also supports image-to-image generation where an input image is transformed toward a prompt, and image in-painting where parts of an existing image are filled in with generated content using a mask.
Refinement and Fine-Tuning
SDXL supports refinement through a separate refiner model that adds finer detail to outputs. Two refinement modes are available: ensemble of experts, where the base model handles early steps (high noise) before handing over to the refining model for final steps (low noise), producing more detailed images from fewer steps with a configurable handover point defaulting to 80%; and one-after-the-other, where the final output from the base model is passed to the refiner with configurable steps. Fine-tuning is supported through the Replicate fine-tuning API, with parameters including input images (required zip or tar file), resolution, batch size, number of training epochs, learning rates, LoRA training options, token strings, caption prefixes, and masking options. Before fine-tuning, input images are preprocessed using SwinIR for upscaling, BLIP for captioning, and CLIPSeg for removing uninteresting regions.