> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-hi/image-generation/flux2-klein.md).

# FLUX.2 Klein

FLUX.2 Klein जिसे Black Forest Labs ने विकसित किया है, FLUX.1 का उत्तराधिकारी है, जो वही इमेज गुणवत्ता **20–60× की गति**पर प्रदान करता है। जहाँ FLUX.1 ने प्रति इमेज 10–30 सेकंड लिए, FLUX.2 Klein उत्पन्न करता है **0.5 सेकंड से कम समय में** एक RTX 4090 पर। यह एक 32B Diffusion Transformer (DiT) मॉडल है जिसका लाइसेंस Apache 2.0 है, और जनवरी 2026 के अनुसार, यह Ollama में प्रयोगात्मक रूप से भी समर्थित है।

## प्रमुख विशेषताएँ

* **< 0.5 सेकंड जनरेशन**: FLUX.1 की तुलना में 20–60× तेज़
* **32B DiT आर्किटेक्चर**: FLUX.1 के समान गुणवत्ता dev
* **Apache 2.0 लाइसेंस**: पूर्ण व्यावसायिक उपयोग
* **Ollama समर्थन**: Ollama के माध्यम से प्रयोगात्मक इमेज जनरेशन (जनवरी 2026)
* **ComfyUI संगत**: FLUX.1 वर्कफ़्लोज़ के लिए ड्रॉप-इन प्रतिस्थापन
* **LoRA + ControlNet**: समुदाय एडाप्टर्स उपलब्ध

## आवश्यकताएँ

| घटक   | न्यूनतम                | अनुशंसित      |
| ----- | ---------------------- | ------------- |
| GPU   | RTX 3090 24GB          | RTX 4090 24GB |
| VRAM  | 16GB (ऑफलोडिंग के साथ) | 24GB          |
| RAM   | 32GB                   | 64GB          |
| डिस्क | 40GB                   | 60GB          |
| CUDA  | 12.0+                  | 12.1+         |

**अनुशंसित Clore.ai GPU**: RTX 4090 24GB (\~$0.5–2/दिन) — सब-सेकंड जनरेशन

### गति तुलना: FLUX.1 बनाम FLUX.2 Klein

| GPU      | FLUX.1 dev (20 चरण) | FLUX.2 Klein | स्पीडअप |
| -------- | ------------------- | ------------ | ------- |
| RTX 3090 | \~25 सेकंड          | \~1.2 सेकंड  | 20×     |
| RTX 4090 | \~12 सेकंड          | \~0.4 सेकंड  | 30×     |
| RTX 5090 | \~8 सेकंड           | \~0.25 सेकंड | 32×     |
| H100     | \~5 सेकंड           | \~0.15 सेकंड | 33×     |

## diffusers के साथ त्वरित शुरुआत

```python
import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.2-klein",
    torch_dtype=torch.bfloat16
)
pipe.to("cuda")

# < 0.5 सेकंड में इमेज जनरेट करें!
image = pipe(
    prompt="a cyberpunk GPU mining rig in a neon-lit server room, photorealistic",
    height=1024,
    width=1024,
    num_inference_steps=4,  # Klein को सिर्फ 4 चरण चाहिए!
    guidance_scale=3.5,
).images[0]

image.save("output.png")
```

### मेमोरी-एफिशिएंट मोड (16GB GPU)

```python
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.2-klein",
    torch_dtype=torch.bfloat16
)
pipe.enable_model_cpu_offload()  # 16GB में फिट होता है
pipe.vae.enable_tiling()         # ~2GB बचाता है

image = pipe("a mountain landscape at sunset", num_inference_steps=4).images[0]
```

## ComfyUI वर्कफ़्लो

FLUX.2 Klein मौजूदा FLUX.1 ComfyUI वर्कफ़्लोज़ में ड्रॉप-इन प्रतिस्थापन के रूप में काम करता है:

1. FLUX.2 Klein चेकपॉइंट डाउनलोड करें `ComfyUI/models/diffusion_models/`
2. अपने वर्कफ़्लो में, चेकपॉइंट नोड को FLUX.2 Klein की ओर बदलें
3. चरणों को 4 पर घटाएँ (FLUX.1 के लिए 20–50 की जगह)
4. गाइडेंस स्केल को 3.0–4.0 पर सेट करें

```bash
# ComfyUI के लिए मॉडल डाउनलोड करें
cd ComfyUI/models/diffusion_models/
wget https://huggingface.co/black-forest-labs/FLUX.2-klein/resolve/main/flux2-klein.safetensors
```

## बैच जनरेशन

सब-सेकंड जनरेशन के साथ, FLUX.2 Klein बहुत बड़े बैच प्रोसेसिंग को सक्षम करता है:

```python
import torch
from diffusers import FluxPipeline

pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.2-klein", torch_dtype=torch.bfloat16
).to("cuda")

prompts = [
    "a red sports car on a mountain road, cinematic",
    "a cozy coffee shop interior, warm lighting",
    "an astronaut floating above Earth, hyperrealistic",
    "a medieval castle in autumn, fantasy art",
    # ... सैकड़ों और जोड़ें
]

for i, prompt in enumerate(prompts):
    image = pipe(prompt, num_inference_steps=4, guidance_scale=3.5).images[0]
    image.save(f"batch_{i:04d}.png")
    print(f"Generated {i+1}/{len(prompts)}")

# RTX 4090 पर: ~100 इमेज एक मिनट से कम में!
```

## LoRA समर्थन

```python
pipe = FluxPipeline.from_pretrained(
    "black-forest-labs/FLUX.2-klein", torch_dtype=torch.bfloat16
).to("cuda")

# FLUX आर्किटेक्चर पर प्रशिक्षित LoRA लोड करें
pipe.load_lora_weights("your-lora/flux2-style-lora", weight_name="lora.safetensors")
pipe.fuse_lora(lora_scale=0.8)

image = pipe("a portrait in the trained style", num_inference_steps=4).images[0]
```

## Clore.ai उपयोगकर्ताओं के लिए सुझाव

* **बैच प्रोसेसिंग का राजा**: 0.4 सेकंड/इमेज पर, आप RTX 4090 पर प्रति घंटा 10,000+ इमेज जेनरेट कर सकते हैं
* **सिर्फ 4 चरण**: अधिक का उपयोग न करें — Klein 4 चरणों के लिए अनुकूलित है (अधिक करने से गुणवत्ता में सुधार नहीं होता)
* **FLUX.1 के समान LoRAs**: अधिकांश FLUX.1 LoRAs Klein के साथ संगत हैं
* **ComfyUI ड्रॉप-इन**: बस चेकपॉइंट बदलें, चरणों को 4 पर सेट करें
* **RTX 3090 व्यवहार्य है**: 1.2 सेकंड/इमेज अभी भी शानदार है \~$0.3/दिन पर

## समस्याओं का निवारण

| समस्या                  | समाधान                                                                         |
| ----------------------- | ------------------------------------------------------------------------------ |
| 24GB पर OOM             | उपयोग करें `enable_model_cpu_offload()` + `vae.enable_tiling()`                |
| धुंधली इमेजेस           | सुनिश्चित करें `num_inference_steps=4`, कम नहीं। गाइडेंस\_स्केल 3.0–4.0 जांचें |
| पहली जेनरेशन धीमी है    | सामान्य — मॉडल पहले कॉल पर लोड होता है (\~30s)। बाद में: सब-सेकंड              |
| ComfyUI चेकपॉइंट त्रुटि | सुनिश्चित करें कि आपके पास `.safetensors` फ़ाइल है, diffusers फॉर्मेट नहीं     |

## अधिक पढ़ने के लिए

* [FLUX.1 गाइड](/guides/guides_v2-hi/image-generation/flux.md) — LoRA और ControlNet विवरण के साथ मूल FLUX गाइड
* [ComfyUI गाइड](/guides/guides_v2-hi/image-generation/comfyui.md) — ComfyUI सेटअप और वर्कफ़्लोज़
* [Black Forest Labs ब्लॉग](https://blackforestlabs.ai/)
* [HuggingFace मॉडल](https://huggingface.co/black-forest-labs/FLUX.2-klein)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-hi/image-generation/flux2-klein.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
