Flux Kontext Dev Image Edit - After
Flux Kontext Dev Image Edit - Before

The 'Flux Kontext Dev Image Edit' workflow is designed for advanced image editing tasks that require maintaining character consistency and editing specific parts of an image without altering others. This workflow leverages the Flux.1 Kontext model, which is adept at understanding and preserving the original style of images while making precise modifications. By utilizing nodes such as SaveImage, MarkdownNote, LoadImage, and a custom node identified by its unique ID, this workflow provides a robust framework for targeted image alterations. Technically, it works by loading an image, applying specified edits using the diffusion model 'flux1-dev-kontext_fp8_scaled.safetensors', and saving the edited image, ensuring that the integrity of the original style and character details are preserved. This makes it particularly useful for applications where maintaining visual consistency is crucial, such as in character design for games or animated series.

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.

flux_kontext_dev_basic.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 "Flux Kontext Dev 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("flux_kontext_dev_basic_api.json");

const asset = client.assets.fromFile("input.png");
wf.setInput("190", "image", asset); // LoadImage

const job = await client.run(wf);
await job.getOutputs("136")[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