Views
No views yet
| Base model | black-forest-labs/FLUX.1-dev |
| Training dataset | SeifElden2342532/characters_descriptions (2016 images) |
| LoRA rank | 16 |
| LoRA alpha | 16 |
| Training steps | 2000 |
| Resolution | 512×512 |
| Effective batch size | 4 (batch 1 × grad accum 4) |
| Learning rate | 1e-4 (cosine schedule) |
| GPU | NVIDIA H100 80GB |
| Training time | ~10 minutes |
| Framework | Diffusers + PEFT |
pip install torch diffusers transformers accelerate peft safetensors1import torch
2from diffusers import FluxPipeline
3from peft import PeftModel
4
5# 1. Load base model
6pipe = FluxPipeline.from_pretrained(
7 "black-forest-labs/FLUX.1-dev",
8 torch_dtype=torch.bfloat16,
9 token="YOUR_HF_TOKEN", # FLUX.1-dev requires access
10).to("cuda")
11
12# 2. Load LoRA weights
13pipe.transformer = PeftModel.from_pretrained(
14 pipe.transformer,
15 "SeifElden2342532/flux-lora-characters",
16)
17pipe.transformer = pipe.transformer.merge_and_unload()
18
19# 3. Generate
20image = pipe(
21 prompt = "a portrait of a warrior character with armor",
22 num_inference_steps = 28,
23 guidance_scale = 3.5,
24 generator = torch.Generator("cuda").manual_seed(42),
25).images[0]
26
27image.save("character.png")a portrait of a warrior character with heavy armor and a sword
a mage character with glowing robes and a magical staff
a rogue character with a hood and daggers
a healer character with white robes and a holy symbol
a portrait of a character with detailed facial featuresto_q, to_k, to_v, to_out.0, add_q_proj, add_k_proj, add_v_proj3.5 (required for FLUX.1-dev distillation)black-forest-labs/FLUX.1-dev is gated)