![Flux.2 [Klein] 4B Distilled: Image Edit](https://media.comfy.org/hub-media/images/0de3d559-0175-4bbd-aefc-b48803197d5c.jpg)
This ComfyUI workflow, titled 'Flux.2 [Klein] 4B Distilled: Image Edit', is designed to facilitate rapid image editing with a focus on interactive applications and real-time previews. Utilizing the Flux.2 Klein model, this workflow is optimized for latency-critical production environments where speed is paramount. The workflow employs several key nodes, including 'SaveImage' for output storage, 'LoadImage' for input handling, and a unique node identified as '7b34ab90-36f9-45ba-a665-71d418f0df18' for processing. Additionally, it features a 'MarkdownNote' node for documentation and guidance within the workflow itself.
Technically, the workflow leverages the power of the Flux.2 Klein model, known for its efficiency in processing and generating high-quality image edits quickly. The inclusion of the 'Multiple input example' workflow group allows users to toggle between different input configurations, enhancing flexibility and user control. This setup is particularly useful for users who need to make quick adjustments or iterations in a production setting, such as graphic designers or digital artists working under tight deadlines.
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 "Flux.2 [Klein] 4B Distilled: 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_flux2_klein_image_edit_4b_distilled_api.json");
const asset = client.assets.fromFile("input.png");
wf.setInput("81", "image", asset); // LoadImage
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













