![Flux.2 [Klein] 9B: Text to Image](https://comfy-hub-assets.comfy.org/templates/be24fa94-b716-406f-868f-5f2a90d184f6.png)
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.
GET https://comfy.org/workflows/download/1606e79dd224.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.2 [Klein] 9B: Text to Image" (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("image_flux2_text_to_image_9b_api.json")
job = client.run(wf)
for output in job.get_outputs("9"): # 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














