FLUX.2 [klein] 4B LoRA

This Diffusers LoRA was trained on black-forest-labs/FLUX.2-klein-base-4B using the facebook/winoground dataset. It can be loaded on the fast distilled black-forest-labs/FLUX.2-klein-4B pipeline for four-step inference.

import torch
from diffusers import Flux2KleinPipeline

from huggingface_hub import hf_hub_download

lora_path = hf_hub_download(
    repo_id="margin2model/flux2-klein-4b-lora-test",
    filename="pytorch_lora_weights.safetensors",
)

pipe = Flux2KleinPipeline.from_pretrained(
    "black-forest-labs/FLUX.2-klein-4B",
    torch_dtype=torch.bfloat16,
)
pipe.enable_model_cpu_offload()
pipe.load_lora_weights(lora_path)

image = pipe(
    prompt='A cinematic portrait, detailed, soft studio lighting',
    num_inference_steps=4,
    guidance_scale=1.0,
    height=512,
    width=512,
    generator=torch.Generator(device="cuda").manual_seed(0),
).images[0]
image.save("image.png")

The adapter is stored as pytorch_lora_weights.safetensors in Diffusers-native FLUX.2 [klein] format.

Downloads last month
7
Inference Providers NEW

Model tree for margin2model/flux2-klein-4b-lora-test

Adapter
(96)
this model