![Flux.2 [Klein] 4B: Text to Image](https://media.comfy.org/hub-media/images/98f682fb-34b7-4b22-9839-3b5553356cad.jpg)
This ComfyUI workflow, titled 'Flux.2 [Klein] 4B: Text to Image,' leverages the BFL distilled model to generate high-quality images from text prompts with remarkable speed. The workflow is designed to deliver outstanding image quality in sub-second timeframes, making it ideal for applications that require real-time image generation. At its core, the workflow utilizes the Flux and Flux.2 Klein models, which are known for their efficiency and precision in text-to-image conversion.
The technical foundation of this workflow includes several key nodes: the SaveImage node for outputting generated images, the PrimitiveStringMultiline node for handling text inputs, and the MarkdownNote node for embedding notes and instructions within the workflow. The node identified as '7b34ab90-36f9-45ba-a665-71d418f0df18' plays a crucial role in processing the text input through the Qwen 3.4B text encoder, which is essential for understanding and translating textual descriptions into visual representations. This workflow is particularly useful for users who need to generate images quickly without compromising on quality, such as in marketing or dynamic content creation scenarios.
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: Text to Image" (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_text_to_image_api.json");
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













