擴展圖像是一個引導式外擴(outpainting)流程,可將單張照片擴展至任意目標長寬比,且不裁切或扭曲原始像素。流程會用純綠色邊框包住原圖,達到新畫布尺寸,然後用 Qwen Image Edit 2511 僅替換綠色區域,生成可信的場景延續。核心工具節點——GetImageSize、ImageResizeKJv2、CustomCombo 與 ComfyNumberConvert——計算新尺寸與邊界,確保原圖置中且不被更動,周圍才是可編輯區。
為讓新內容風格與主題一致,流程可自動用 TextGenerateLTX2Prompt 與本地 VLM 後端(需自行設定)為缺失區域寫續景描述,再用 JsonExtractString 解析結果。ComfySwitchNode 可切換自動描述或手動輸入(PrimitiveStringMultiline)。最終指令由 StringConcatenate 組合,搭配 CLIPLoader(如需文字條件)引導 Qwen Image Edit 2511 合成光線、材質與透視。PreviewAny 與 ImageCompare 幫助你評估變化,SaveImageAdvanced 儲存外擴結果與中繼資料,方便重現。
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.
常見問題














