flux2-klein-4b-stamp-filter

LoRA adapter for unsloth/FLUX.2-klein-4B that turns a photo into a grainy, print-textured field-notes illustration on a white background.

This is an image-conditioned (image-to-image) adapter. It was trained on photo โ†’ illustration pairs with the photo fed to the model as reference tokens, so at inference you must pass a condition image โ€” plain text-to-image with this adapter is not the intended use.

Trigger word: stamp

Example

photo (left) โ†’ stamp illustration (right)

Input photo (left) and the adapter's output (right), held-out photo, 4 sampling steps.

Usage

import torch
from diffusers import Flux2KleinPipeline
from PIL import Image

pipe = Flux2KleinPipeline.from_pretrained(
    "unsloth/FLUX.2-klein-4B", torch_dtype=torch.float16
)
pipe.load_lora_weights("vladimir94/flux2-klein-4b-stamp-filter")
pipe.to("mps")  # or "cuda"

cond = Image.open("photo.jpg").convert("RGB")
out = pipe(
    image=cond,
    prompt="stamp",
    num_inference_steps=4,  # Klein is step-distilled; 4 steps is enough
    guidance_scale=1.0,     # ignored by step-distilled models anyway
).images[0]
out.save("stamp.png")

Output size follows the condition image's aspect ratio (training used aspect-preserving resize, no cropping).

Training details

  • Base model: unsloth/FLUX.2-klein-4B (Flux2Transformer2DModel)
  • Task: paired image-to-image โ€” condition photo appended as extra latent tokens, loss on target tokens only
  • Dataset: 233 photo โ†’ isolated-drawing-on-white pairs, all captioned stamp
  • Rank / alpha: 8 / 8, targeting to_qkv_mlp_proj, to_q, to_k, to_v, to_out.0
  • Resolution: up to 768ร—768 total area, aspect preserved, downscale-only, no center crop
  • Steps: 700 (~3 epochs), lr 1e-4 constant, fp16 (full LoRA, not quantized), batch 1
  • Hardware: Apple Silicon (MPS), ~3 hours
  • Final mean loss: 0.60

Limitations

  • Requires a condition image; without one the output is unpredictable.
  • Best on landscape/nature photos similar to the training set (field-notes subjects).
  • 4-step sampling only โ€” the base model is step-distilled; more steps can wash out detail.

Framework versions

  • PEFT 0.18.1
  • diffusers 0.40.0.dev0
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for vladimir94/flux2-klein-4b-stamp-filter

Adapter
(1)
this model