Skip to content

Support Flux Klein peft (fal) lora format - #13169

Merged
sayakpaul merged 1 commit into
mainfrom
klein-peft-format
Feb 21, 2026
Merged

Support Flux Klein peft (fal) lora format#13169
sayakpaul merged 1 commit into
mainfrom
klein-peft-format

Conversation

@asomoza

@asomoza asomoza commented Feb 20, 2026

Copy link
Copy Markdown
Member

FAL trained loras use the default peft key naming, this PR just rename them to the diffusers naming.

Fixes #13162

Tested with this lora

code

import torch

from diffusers import Flux2KleinPipeline
from diffusers.utils import load_image


device = "cuda"
dtype = torch.bfloat16

pipe = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4b", torch_dtype=dtype)
pipe.load_lora_weights(
    "fal/flux-2-klein-4b-spritesheet-lora",
    weight_name="flux-spritesheet-lora.safetensors",
)
pipe.enable_model_cpu_offload()

prompt = "2x2 sprite sheet"
image = load_image(
    "https://huggingface.co/datasets/OzzyGT/testing-resources/resolve/main/edit/julian-hochgesang-1fDZ4BijtG0-unsplash.jpg"
)

image = pipe(
    prompt=prompt,
    image=image,
    height=1024,
    width=1024,
    guidance_scale=1.0,
    num_inference_steps=4,
    generator=torch.Generator(device=device).manual_seed(42),
).images[0]
image.save("flux-klein.png")
source image result
julian-hochgesang-1fDZ4BijtG0-unsplash flux-klein

Who can review?

@christopher5106 @sayakpaul

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@christopher5106 christopher5106 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me but your tests seem to fail

@asomoza

asomoza commented Feb 20, 2026

Copy link
Copy Markdown
Member Author

yeah but test is unrelated, it fails with wan vace.

@sayakpaul sayakpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

@sayakpaul
sayakpaul merged commit a80b192 into main Feb 21, 2026
31 of 33 checks passed
@sayakpaul
sayakpaul deleted the klein-peft-format branch February 21, 2026 05:01
tolgacangoz pushed a commit to tolgacangoz/diffusers that referenced this pull request Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flux.2-klein-4b lora support

4 participants