SDXL Refiner Prompt

This ComfyUI workflow is designed to enhance images generated by the Stable Diffusion XL (SDXL) model using refiner models. It leverages a series of nodes to create a refined image output that is both high-quality and visually appealing. The workflow begins with loading the base SDXL model using the CheckpointLoaderSimple node, which is configured to automatically apply optimal settings for the selected SD model version. The workflow then proceeds to generate an initial latent image using the EmptyLatentImage node, which serves as the canvas for further refinement.

The core of this workflow involves the use of the CLIPTextEncode node to interpret text prompts, which guide the image generation process. The KSamplerAdvanced node introduces controlled noise into the image, allowing the model to iteratively refine and enhance the visual output. After the image has been refined, the VAEDecode node converts the latent image data into a visible format, ready for final adjustments. The SaveImage node then allows users to save the enhanced image in PNG format. This workflow is particularly useful for artists and designers who require high-quality, refined images for their projects, as it combines the power of SDXL models with advanced refinement techniques.

API

Use this workflow from code

Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.

sdxl_refiner_prompt_example.json
Fetching workflow JSON…

Run it from TypeScript or Python with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.

// Install (beta)
npm i @comfyorg/sdk

// Run "SDXL Refiner Prompt" (TypeScript)
import { Comfy } from "@comfyorg/sdk";

const client = new Comfy({ apiKey: "comfyui-..." });

// This workflow, exported in API format (see note below)
const wf = await client.workflows.fromFile("sdxl_refiner_prompt_example_api.json");

wf.setInput("16", "text", "text, watermark"); // CLIPTextEncode

const job = await client.run(wf);
await job.getOutputs("19")[0].toFile("output.png"); // SaveImage

The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API).

Comfy Cloud API access requires a plan with an API key.

FAQ

Frequently Asked Questions

View all workflows
Showing 30 of 30 templates