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.
GET https://comfy.org/workflows/download/6f75cc57d5d6.jsonFetching workflow JSON…
Run it from Python or TypeScript with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.
# Install (beta)
pip install comfy-sdk # Python
npm i @comfyorg/sdk # TypeScript
# Run "Flux Kontext Dev Image Edit" (Python)
from comfy_sdk import Comfy
client = Comfy(api_key="comfyui-...")
# This workflow, exported in API format (see note below)
wf = client.workflows.from_file("flux_kontext_dev_basic_api.json")
asset = client.assets.from_file("input.png")
wf.set_input("190", "image", asset) # LoadImage
job = client.run(wf)
for output in job.get_outputs("136"): # SaveImage
output.to_file(output.name)The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API). API access requires a Comfy Cloud plan with an API key. SDK docs · Get an API key
FAQ
















