We have partnered with Black Forest Labs (BFL) again to bring their optimized FLUX.2 [klein] 9B model to Workers AI. This distilled model offers enhanced quality compared to the 4B variant, while maintaining cost-effective pricing. With a fixed 4-step inference process, Klein 9B is ideal for rapid prototyping and real-time applications where both speed and quality matter.
Read the BFL blog to learn more about the model itself, or try it out yourself on our multi modal playground.
Pricing documentation is available on the model page or pricing page.
Workers AI platform specifics
The model hosted on Workers AI is optimized for speed with a fixed 4-step inference process and supports up to 4 image inputs. Since this is a distilled model, the steps parameter is fixed at 4 and cannot be adjusted. Like FLUX.2 [dev] and FLUX.2 [klein] 4B, this image model uses multipart form data inputs, even if you just have a prompt.
With the REST API, the multipart form data input looks like this:
curl --request POST \ --url 'https://api.cloudflare.com/client/v4/accounts/{ACCOUNT}/ai/run/@cf/black-forest-labs/flux-2-klein-9b' \ --header 'Authorization: Bearer {TOKEN}' \ --header 'Content-Type: multipart/form-data' \ --form 'prompt=a sunset at the alps' \ --form width=1024 \ --form height=1024With the Workers AI binding, you can use it as such:
const form = new FormData();form.append("prompt", "a sunset with a dog");form.append("width", "1024");form.append("height", "1024");
const resp = await env.AI.run("@cf/black-forest-labs/flux-2-klein-9b", { multipart: { body: form, contentType: "multipart/form-data", },});The parameters you can send to the model are detailed here:
JSON Schema for Model
Required Parametersprompt(string) – Text description of the image to generate
Optional Parameters
input_image_0(string) – Binary imageinput_image_1(string) – Binary imageinput_image_2(string) – Binary imageinput_image_3(string) – Binary imageguidance(float) – Guidance scale for generation. Higher values follow the prompt more closelywidth(integer) – Width of the image, default1024Range: 256-1920height(integer) – Height of the image, default768Range: 256-1920seed(integer) – Seed for reproducibility
Note: Since this is a distilled model, the steps parameter is fixed at 4 and cannot be adjusted.
Multi-reference images
The FLUX.2 klein-9b model supports generating images based on reference images, just like FLUX.2 [dev] and FLUX.2 [klein] 4B. You can use this feature to apply the style of one image to another, add a new character to an image, or iterate on past generated images. You would use it with the same multipart form data structure, with the input images in binary. The model supports up to 4 input images.
For the prompt, you can reference the images based on the index, like take the subject of image 1 and style it like image 0 or even use natural language like place the dog beside the woman.
You must name the input parameter as input_image_0, input_image_1, input_image_2, input_image_3 for it to work correctly. All input images must be smaller than 512×512.
curl --request POST \ --url 'https://api.cloudflare.com/client/v4/accounts/{ACCOUNT}/ai/run/@cf/black-forest-labs/flux-2-klein-9b' \ --header 'Authorization: Bearer {TOKEN}' \ --header 'Content-Type: multipart/form-data' \ --form 'prompt=take the subject of image 1 and style it like image 0' \ --form input_image_0=@/Users/johndoe/Desktop/icedoutkeanu.png \ --form input_image_1=@/Users/johndoe/Desktop/me.png \ --form width=1024 \ --form height=1024Through Workers AI Binding:
//helper function to convert ReadableStream to Blobasync function streamToBlob(stream: ReadableStream, contentType: string): Promise<Blob> { const reader = stream.getReader(); const chunks = [];
while (true) { const { done, value } = await reader.read(); if (done) break; chunks.push(value); }
return new Blob(chunks, { type: contentType });}
const image0 = await fetch("http://image-url");const image1 = await fetch("http://image-url");const form = new FormData();
const image_blob0 = await streamToBlob(image0.body, "image/png");const image_blob1 = await streamToBlob(image1.body, "image/png");form.append('input_image_0', image_blob0)form.append('input_image_1', image_blob1)form.append('prompt', 'take the subject of image 1 and style it like image 0')
const resp = await env.AI.run("@cf/black-forest-labs/flux-2-klein-9b", { multipart: { body: form, contentType: "multipart/form-data" }})Source: Cloudflare
Latest Posts
- Zero Trust WARP Client – WARP client for Windows (version 2026.1.89.1)

- Zero Trust WARP Client – WARP client for macOS (version 2026.1.89.1)

- (Updated) Changing output format for some database properties in Exchange Online cmdlets [MC1108848]
![(Updated) Changing output format for some database properties in Exchange Online cmdlets [MC1108848] 4 pexels googledeepmind 17483906](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Workers – Support for ctx.exports in @cloudflare/vitest-pool-workers

![Workers AI - Launching FLUX.2 [klein] 9B on Workers AI 1 Workers AI – Launching FLUX.2 [klein] 9B on Workers AI](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-philippedonn-1133957-1024x683.webp)


![(Updated) Changing output format for some database properties in Exchange Online cmdlets [MC1108848] 4 pexels googledeepmind 17483906](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-googledeepmind-17483906-150x150.webp)

![(Updated) Microsoft Copilot in Teams: Visual Insight for intelligent recap [MC1115314] 7 (Updated) Microsoft Copilot in Teams: Visual Insight for intelligent recap [MC1115314]](https://mwpro.co.uk/wp-content/uploads/2025/06/pexels-urlapovaanna-2957060-96x96.webp)