Flux.2 [Klein] 9B: Text to Image

This ComfyUI workflow leverages the Flux.2 [Klein] 9B model to transform text prompts into high-quality images with remarkable speed. At its core, the workflow utilizes a BFL distilled model, which is known for its efficiency and quality, making it ideal for real-time image generation. The workflow incorporates several nodes, including the SaveImage node for output handling and the PrimitiveStringMultiline node for managing text inputs. Additionally, the MarkdownNote node is used for embedding documentation or notes within the workflow, enhancing user understanding and ease of use. The subgraph feature is a key component, allowing users to encapsulate and reuse complex node arrangements, streamlining the workflow process.

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.

image_flux2_text_to_image_9b.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.2 [Klein] 9B: 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_text_to_image_9b_api.json");

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