The '2.2 Creator - Diffusion Guidance' workflow in ComfyUI is designed to enhance image editing precision by integrating inpainting and ControlNet techniques. At the core of this workflow is the Z Image Turbo model, which facilitates efficient and accurate diffusion processes. The workflow employs a variety of nodes, such as CLIPLoader and VAELoader, to load and process images, while nodes like DifferentialDiffusion and InpaintModelConditioning are used to guide the diffusion process with spatially varying changes. This makes it particularly useful for tasks that require detailed image editing without the need for model retraining.
The workflow leverages ControlNet to provide structural guidance, such as canny edges or depth maps, to ensure that the diffusion process adheres to desired structural elements. This is achieved through nodes like ZImageFunControlnet and Controlnet Preprocessor. By using per-pixel 'strength' maps, the workflow allows for smooth and gradual changes, making it ideal for applications that demand high precision and control, such as inpainting specific image areas while maintaining the integrity of the surrounding context.
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.
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 this workflow (TypeScript)
import { Comfy } from "@comfyorg/sdk";
const client = new Comfy({ apiKey: "comfyui-..." });
const wf = await client.workflows.fromFile("workflow_api.json");
const job = await client.run(wf);
await job.getOutputs("<output-node-id>")[0].toFile("output.png");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.
الأسئلة الشائعة
















