DirtScan commited on
Commit
f964c53
·
verified ·
1 Parent(s): 96f9bb1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -74
README.md CHANGED
@@ -13,82 +13,14 @@ tags:
13
 
14
  # Trail Delighter — FLUX.2 Klein 4B LoRA
15
 
16
- This is a source-conditioned LoRA for **FLUX.2 Klein 4B**. It was trained for
17
- one narrow task: reducing cast shadows, glare, and uneven illumination in
18
- trail-surface photographs while preserving the camera viewpoint and physical
19
- scene structure.
20
 
21
- It is not a general-purpose shadow-removal model. The training set consists of
22
- real Chunk 0 trail photographs paired with Qwen/Fal lighting-restoration
23
- outputs. The model is intended for texture-capture imagery and may perform
24
- poorly on unrelated photographs.
25
-
26
- ## Files
27
-
28
- - `training/trail_delight_klein4b_highres15.safetensors` — final LoRA
29
- - `training/checkpoints/` — 125, 250, and 375 step checkpoints
30
- - `examples/teacher_pairs/original/` — original trail photos
31
- - `examples/teacher_pairs/qwen_delighted/` — Qwen/Fal teacher outputs
32
- - `examples/teacher_pairs/klein_lora/` — corresponding Klein LoRA outputs
33
-
34
- The base FLUX.2 Klein weights are not included. Download them from the
35
- upstream model repository separately.
36
-
37
- ## Inference with Diffusers
38
-
39
- ```python
40
- import torch
41
- from diffusers import Flux2KleinPipeline
42
- from diffusers.utils import load_image
43
-
44
- base = "black-forest-labs/FLUX.2-klein-4B"
45
- lora = "DirtScan/trail-delighter"
46
-
47
- pipe = Flux2KleinPipeline.from_pretrained(base, torch_dtype=torch.float16)
48
- pipe.load_lora_weights(lora, subfolder="training", adapter_name="trail_delight")
49
- pipe.set_adapters(["trail_delight"], adapter_weights=[1.0])
50
- pipe.enable_sequential_cpu_offload(device="cuda")
51
- pipe.vae.enable_tiling()
52
- pipe.vae.enable_slicing()
53
-
54
- image = load_image("input-trail-photo.png").convert("RGB").resize((768, 448))
55
- result = pipe(
56
- image=image,
57
- prompt=(
58
- "Edit this trail-surface photograph under neutral soft overcast illumination. "
59
- "Remove cast shadows and glare while preserving the exact trail geometry, "
60
- "rocks, leaves, markings, materials, and camera viewpoint."
61
- ),
62
- width=768,
63
- height=448,
64
- num_inference_steps=4,
65
- guidance_scale=1.0,
66
- ).images[0]
67
- result.save("trail-delighted.png")
68
- ```
69
-
70
- For local inference, the final LoRA is small, but the unquantized base model
71
- is substantially larger than an 8 GB GPU. Sequential CPU offload or a
72
- compatible quantized runtime may be required.
73
-
74
- ## Training summary
75
-
76
- - Base: FLUX.2 Klein 4B
77
- - Adapter: LoRA, rank 16
78
- - Teacher: Qwen Image Edit lighting-restoration via Fal
79
- - Teacher pairs: 15 real Chunk 0 trail-photo pairs
80
- - Resolution used for the student run: 768 × 448
81
- - Final checkpoint: 500 training steps
82
-
83
- ## Limitations
84
-
85
- The adapter can still produce image-to-image hue variation, local texture
86
- changes, or residual seams when many independently processed views are merged
87
- into a texture atlas. It should therefore be followed by atlas-level colour
88
- harmonization and seam-aware blending for 3D texturing.
89
 
90
  ## License
91
 
92
  The adapter is provided under Apache-2.0, subject to the terms of the base
93
- FLUX.2 Klein model and the rights to the training photographs and teacher
94
- outputs.
 
13
 
14
  # Trail Delighter — FLUX.2 Klein 4B LoRA
15
 
16
+ This is a LoRA for **FLUX.2 Klein 4B** specifically for the task of giving natural light to mountain bike trail photographs.
 
 
 
17
 
18
+ The process was as follows:
19
+ - Photos are taken of a mountain bike trail (often sunny, cast shadows, lens flare, glare)
20
+ - A selection of these were de-lighted using https://fal.ai/models/fal-ai/qwen-image-edit-2509-lora-gallery/lighting-restoration - This creates a "teacher set"
21
+ - This teacher set was then used to train a new LoRA, but with a base of **FLUX.2 Klein 4B** (instead of Qwen) - overall making the model smaller and easier to run.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  ## License
24
 
25
  The adapter is provided under Apache-2.0, subject to the terms of the base
26
+ FLUX.2 Klein model.