「2.2 Creator - 擴散引導」工作流程於 ComfyUI 中,透過結合修補與 ControlNet 技術,提升圖像編輯精度。核心為 Z Image Turbo 模型,能高效且精確地進行擴散處理。流程包含 CLIPLoader、VAELoader 等節點負責圖像載入與處理,並以 DifferentialDiffusion、InpaintModelConditioning 等節點,針對空間變化引導擴散,無需重新訓練模型即可進行細緻編輯。
流程運用 ControlNet 提供結構引導,如邊緣偵測或深度圖,確保擴散過程遵循結構特徵。這透過 ZImageFunControlnet 與 Controlnet Preprocessor 節點實現。利用每像素「強度」圖,流程可平滑且漸進地變化,特別適合需高精度與控制的應用,例如修補特定區域並維持周圍內容完整。
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.
常見問題
















