The OmniGen2 Image Edit workflow is designed to enhance and transform images using natural language instructions. Leveraging the powerful OmniGen model, this workflow enables users to apply complex edits such as texture transformations and lighting effects with ease. The workflow incorporates several key nodes including CLIPTextEncode for interpreting text prompts, VAEDecode for generating the final image, and SaveImage for outputting the result. By utilizing nodes like ImageScaleToTotalPixels and RandomNoise, the workflow ensures that image transformations are both precise and creative.
Technically, the workflow operates by first loading the necessary models and preparing the image for editing. The CLIPLoader and UNETLoader nodes facilitate the loading and processing of image data, while the DualCFGGuider and SamplerCustomAdvanced nodes provide advanced control over the sampling process. This workflow is particularly useful for artists and designers looking to quickly iterate on image concepts or for anyone needing to make detailed image edits without extensive manual effort.
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 "OmniGen2 Image Edit" (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("image_omnigen2_image_edit_api.json");
const asset = client.assets.fromFile("input.png");
wf.setInput("16", "image", asset); // LoadImage
wf.setInput("7", "text", "your prompt here"); // CLIPTextEncode
const job = await client.run(wf);
await job.getOutputs("9")[0].toFile("output.png"); // SaveImageThe 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















