Norod78/Yarn-art-style
Viewer β’ Updated β’ 18 β’ 73 β’ 12
How to use Barath/flux2-klein-yarn-art-lora with Diffusers:
pip install -U diffusers transformers accelerate
import torch
from diffusers import DiffusionPipeline
# switch to "mps" for apple devices
pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-base-4B", torch_dtype=torch.bfloat16, device_map="cuda")
pipe.load_lora_weights("Barath/flux2-klein-yarn-art-lora")
prompt = "Y4RN_ART, a fox in a forest"
image = pipe(prompt).images[0]A style LoRA for FLUX.2 klein base-4B that renders subjects as yarn / fiber art with dense stitch and thread texture.
Trigger word: Y4RN_ART β the style only activates when the trigger is in the prompt; without it, output stays photorealistic (no style bleed).
import torch
from diffusers import Flux2KleinPipeline
pipe = Flux2KleinPipeline.from_pretrained(
"black-forest-labs/FLUX.2-klein-base-4B", torch_dtype=torch.bfloat16
).to("cuda")
pipe.load_lora_weights("Barath/flux2-klein-yarn-art-lora")
img = pipe(
"Y4RN_ART, a fox in a forest",
num_inference_steps=28, guidance_scale=4.0,
).images[0]
The LoRA was trained on the undistilled base model but also transfers to the 4-step distilled FLUX.2-klein-4B:
pipe = Flux2KleinPipeline.from_pretrained(
"black-forest-labs/FLUX.2-klein-4B", torch_dtype=torch.bfloat16
).to("cuda")
pipe.load_lora_weights("Barath/flux2-klein-yarn-art-lora")
img = pipe("Y4RN_ART, a fox in a forest", num_inference_steps=4, guidance_scale=1.0).images[0]
klein4b_yarn_art_lora_v1.safetensors β final checkpoint (step 1800, recommended)klein4b_yarn_art_lora_v1_000001200.safetensors β step-1200 checkpoint (slightly lighter style)Trained with ostris/ai-toolkit on a single RTX 4090 (~31 min).
Y4RN_ART trigger prefixKnown limitation: still-life / tabletop scenes (e.g. "a cup of coffee on a wooden table") stay photorealistic β the small dataset contains creatures, figures and single objects, so coverage of such scenes is weak.
Base model
black-forest-labs/FLUX.2-klein-base-4B