Instructions to use black-forest-labs/FLUX.2-klein-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use black-forest-labs/FLUX.2-klein-9B with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-9B", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Diffusion Single File
How to use black-forest-labs/FLUX.2-klein-9B with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Inference
- Notebooks
- Google Colab
- Kaggle
Finding: EmptyLatentImage + denoise < 0.85 produces severe artifacts in ComfyUI (4-step distilled sampling limitation)
Hi,
I want to report a behavioral finding with FLUX.2 Klein 9B (distilled, 4-step) that may be useful for the community and for documentation purposes.
Observation:
When using FLUX.2 Klein 9B in ComfyUI with a KSampler node, combining an EmptyLatentImage (dimensions matched via GetImageSize) with denoise values below approximately 0.85 produces increasingly severe artifacts. At denoise 1.0, the output is clean. At 0.85, artifacts begin to appear. At 0.5, the output is heavily corrupted. At 0.4, the output is essentially random noise with no coherent structure.
Replacing EmptyLatentImage with VAEEncode (feeding the actual input image into the latent space) resolves the issue completely at all denoise values.
Analysis:
The denoise parameter preserves a fraction of the starting latent as structural information (1 - denoise = preserved fraction). When the starting latent is empty/random (from EmptyLatentImage), the preserved fraction is random noise that the model interprets as intentional structure.
With only 4 sampling steps (due to step distillation), the model does not have sufficient iterations to overwrite or correct this corrupted starting structure. Traditional multi-step models (20-30 steps) can gradually resolve this, which is why this behavior is not well-documented β it is significantly more pronounced in step-distilled architectures.
Notably, the KV editing pipeline (using ReferenceLatent nodes at effective denoise 1.0) is unaffected, as it reads reference images through attention conditioning rather than through latent preservation.
Recommendation:
It may be helpful to document in the model card or usage guide that for img2img/refinement workflows using the distilled Klein 9B, VAEEncode should be used instead of EmptyLatentImage when denoise < 1.0. This is a practical constraint of 4-step distilled inference that differs from standard diffusion model behavior.
Environment:
Model: FLUX.2-klein-9b
Text encoder: qwen_3_8b
ComfyUI: v0.9.2+
GPU: RTX 4060 Mobile (8GB VRAM)
Sampler: euler, scheduler: simple, steps: 4, cfg: 1.0
Test images attached showing denoise 1.0 (clean), 0.85 (degrading), and 0.5 (corrupted), all other parameters identical.
Thank you.

