Flux.2 [Klein] 9B 蒸餾:圖像編輯 - After
Flux.2 [Klein] 9B 蒸餾:圖像編輯 - Before

The Flux.2 [Klein] 9B Distilled: Image Edit workflow leverages the power of the Flux.2 Klein model to provide high-quality image editing capabilities at impressive speeds. This workflow is designed to enable real-time image generation and editing, making it ideal for applications that require quick turnaround without compromising on quality. The core of this workflow is the Flux.2 Klein model, a distilled version of the original Flux model, which offers outstanding performance by reducing computational load while maintaining the model's efficacy. Key nodes in this workflow include the SaveImage and LoadImage nodes, which handle the input and output of images, and the MarkdownNote node, which provides documentation and guidance within the workflow itself.

Technically, the workflow operates by taking an input image, processing it through the Flux.2 Klein model using a series of nodes that manage data flow and model inference, and finally outputting an edited image. The 7b34ab90-36f9-45ba-a665-71d418f0df18 node is crucial for interfacing with the model, ensuring that the image data is correctly formatted and processed. This setup makes the workflow highly efficient, allowing users to achieve sub-second image editing, which is particularly beneficial for real-time applications such as live video feeds or interactive design tools.

API

從程式碼使用此工作流

每個 Comfy 工作流都是一個 JSON 圖。下方的 payload 就是此工作流,與 ComfyUI 執行時完全相同 — 你可以從此 URL 取得、放入版本控制,或在 ComfyUI 載入並逐節點執行。

image_flux2_klein_image_edit_9b_distilled.json
正在取得工作流 JSON…

使用 Comfy SDK 以 TypeScript 或 Python 執行。相同程式碼可用於 Comfy Cloud 或你自架的 ComfyUI — 只需更改 base URL。

// Install (beta)
npm i @comfyorg/sdk

// Run "Flux.2 [Klein] 9B 蒸餾:圖像編輯" (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_9b_distilled_api.json");

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

const job = await client.run(wf);
await job.getOutputs("9")[0].toFile("output.png"); // SaveImage

SDK 需使用 API 格式的工作流:請在 ComfyUI 開啟此工作流,並使用 檔案 → 匯出工作流(API)。

Comfy Cloud API 存取需有 API 金鑰的方案。

常見問題

常見問題

查看所有工作流
Showing 30 of 30 templates