abdeinorstw nhathoangfoto commited on
Commit
9d22746
·
0 Parent(s):

Duplicate from nhathoangfoto/Flux.2-Klein-9B-MatchingPose

Browse files

Co-authored-by: Jett Huang <nhathoangfoto@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ examples/1a.jpg filter=lfs diff=lfs merge=lfs -text
37
+ examples/1b.png filter=lfs diff=lfs merge=lfs -text
38
+ examples/1c.png filter=lfs diff=lfs merge=lfs -text
39
+ examples/2b.png filter=lfs diff=lfs merge=lfs -text
40
+ examples/2c.png filter=lfs diff=lfs merge=lfs -text
41
+ examples/Example[[:space:]]Workflow.png filter=lfs diff=lfs merge=lfs -text
Maching_Pose_9B_Rank256.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a5946af14acd65e30c2f29b7714f2bb0dc4dc7e7f0ef5849b8b1654d3a4a78c3
3
+ size 1325429960
README.md ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: black-forest-labs/FLUX.2-klein-base-9B
4
+ base_model_relation: adapter
5
+ tags:
6
+ - lora
7
+ - flux
8
+ - flux.2
9
+ - flux.2-klein
10
+ - matchingpose
11
+ - pose-transfer
12
+ - character-consistency
13
+ - diffusers
14
+ - image-to-image
15
+ - text-to-image
16
+ language:
17
+ - en
18
+ pipeline_tag: image-text-to-image
19
+ library_name: diffusers
20
+ instance_prompt: matchingpose9b
21
+ widget:
22
+ - text: "matchingpose9b — cycle through: face reference → mannequin pose → final output"
23
+ output:
24
+ url: examples/1a.jpg
25
+ - text: "matchingpose9b, a young woman matching the mannequin pose, studio lighting"
26
+ output:
27
+ url: examples/1c.png
28
+ - text: "matchingpose9b, a man matching the mannequin pose, studio lighting"
29
+ output:
30
+ url: examples/1c.png
31
+ ---
32
+
33
+ ## 🔴 TUTORIALS COMING SOON — SUBSCRIBE NOW
34
+
35
+ **I'll be dropping in-depth tutorials on AI models, ComfyUI workflows, image & video generation, 3D tools and more.**
36
+
37
+ [![YouTube](https://img.shields.io/badge/▶️_Subscribe-@JettHuangAI-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@JettHuangAI)
38
+
39
+ **[@JettHuangAI](https://www.youtube.com/@JettHuangAI) — Hit 🔔 so you don't miss it!**
40
+
41
+ # 🧍 Flux.2-Klein-9B-MatchingPose
42
+
43
+ **A LoRA adapter for FLUX.2 Klein 9B that transfers any mannequin pose reference onto a character subject — producing perfectly pose-matched characters while preserving the subject's identity, face, and style.**
44
+
45
+ Designed as the companion model to [**Flux.2-Klein-9B-Mannequin**](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-Mannequin) — together they form a complete **pose-transfer and character-consistency pipeline**.
46
+
47
+ ---
48
+
49
+ <div align="center">
50
+
51
+ ### ☕ Support My Work
52
+
53
+ If this LoRA helps your projects, please consider supporting continued development and new model releases.
54
+
55
+ [![PayPal](https://img.shields.io/badge/Donate_via-PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/nhathoangfoto)
56
+
57
+ **→ [paypal.me/nhathoangfoto](https://paypal.me/nhathoangfoto) ←**
58
+
59
+ *Every contribution directly funds training compute, dataset curation, and the release of new open-source LoRAs.*
60
+
61
+ </div>
62
+
63
+ ---
64
+
65
+ For custom LoRA training, advanced ComfyUI workflow development, or collaboration:
66
+ 📱 WhatsApp: +84947397868
67
+ 💬 Telegram/Discord: nhathoangfoto
68
+ 🐦 X: https://x.com/NhatPhoto
69
+ 📘 Facebook: https://www.facebook.com/nhathoangfoto
70
+
71
+ Powerful local hardware, ready for any complex project: 🚀 **RTX 5090** | **RTX Pro 6000** 🛠️
72
+
73
+ ---
74
+
75
+ ## 🖼️ Examples
76
+
77
+ ### Case 1 — complex pose
78
+
79
+ | Input Face | Mannequin Pose | → Output |
80
+ |:---:|:---:|:---:|
81
+ | ![Face 1](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-MatchingPose/resolve/main/examples/1a.jpg) | ![Pose 1](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-MatchingPose/resolve/main/examples/1b.png) | ![Result 1](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-MatchingPose/resolve/main/examples/1c.png) |
82
+
83
+ ### Case 2 — base pose
84
+ | Input Face | Mannequin Pose | → Output |
85
+ |:---:|:---:|:---:|
86
+ | ![Face 2](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-MatchingPose/resolve/main/examples/2a.jpg) | ![Pose 2](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-MatchingPose/resolve/main/examples/2b.png) | ![Result 2](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-MatchingPose/resolve/main/examples/2c.png) |
87
+
88
+ *Left: character reference (face/identity). Middle: mannequin pose reference (generated by the companion [Mannequin LoRA](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-Mannequin)). Right: final output — the character replicating the exact mannequin pose.*
89
+
90
+ ---
91
+
92
+ ## ✨ What this LoRA does
93
+
94
+ - **Transfers any pose from a mannequin reference onto a character** with high pose fidelity
95
+ - **Preserves the character's identity, face, and style** from the face reference
96
+ - **Works with any input face** — photographs, AI-generated characters, illustrations
97
+ - **Matches limb position, body orientation, and overall composition** exactly
98
+ - **Produces natural skin, clothing, and lighting** in the output — not a stiff mannequin render
99
+
100
+ ## 🎯 Why use it
101
+
102
+ Pose transfer in FLUX.2 is challenging because most methods either:
103
+ - **Lose the character's identity** when forcing a pose (ControlNet drift)
104
+ - **Fail to match the pose accurately** when using only text prompts
105
+ - **Require complex multi-ControlNet setups** that are slow and unreliable
106
+
107
+ **MatchingPose LoRA solves this** by using a mannequin as a clean, identity-free pose anchor. Since the mannequin encodes only pose and proportions (no face, no clothing bias), the character LoRA can fill in identity cleanly without pose drift.
108
+
109
+ ---
110
+
111
+ ## 🔗 Complete Workflow — Paired with Mannequin LoRA
112
+
113
+ This LoRA is the second stage of a two-stage pipeline with [**Flux.2-Klein-9B-Mannequin**](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-Mannequin):
114
+
115
+ ```
116
+ ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
117
+ │ Real Reference │ → │ Mannequin LoRA │ → │ Pose Template │
118
+ │ (any photo) │ │ (stage 1 LoRA) │ │ (faceless body) │
119
+ └─────────────────┘ └──────────────────┘ └─────────────────┘
120
+ │
121
+ ▼
122
+ ┌──────────────────┐ ┌────────────────────┐ ┌──────────────┐
123
+ │ Character LoRA / │ → │ MatchingPose LoRA │ → │ Final Output │
124
+ │ Reference Face │ │ (this model) │ │ (your char, │
125
+ └──────────────────┘ └────────────────────┘ │ same pose) │
126
+ └──────────────┘
127
+ ```
128
+
129
+ The two-stage pipeline guarantees **pose consistency across characters** — feed any real photo in, get any character out, same pose.
130
+
131
+ ### 📋 Example Workflow
132
+
133
+ ![Example Workflow](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-MatchingPose/resolve/main/examples/Example%20Workflow.png)
134
+
135
+ *Complete ComfyUI workflow example showing the Mannequin + MatchingPose LoRA chain in action.*
136
+
137
+ ---
138
+
139
+ ## 🎯 Trigger Word
140
+
141
+ ```
142
+ matchingpose9b
143
+ ```
144
+
145
+ This is the primary trigger for the LoRA. Place it at the beginning of your positive prompt to activate the pose-matching behavior.
146
+
147
+ ### Example Prompt Structure
148
+
149
+ ```
150
+ matchingpose9b, a young woman with long brown hair, wearing a white dress,
151
+ matching the reference pose, studio lighting
152
+ ```
153
+
154
+ ```
155
+ matchingpose9b, a man in a black suit, sitting on a stool,
156
+ matching the mannequin pose, natural lighting
157
+ ```
158
+
159
+ ---
160
+
161
+ ## 💡 Tips & Prompting Guide
162
+
163
+ ### 1. Describe the Character, Not the Pose
164
+
165
+ Let the mannequin reference handle the pose. Your prompt should focus on **who the character is** — their appearance, clothing, and style. Describing the pose in text can conflict with the reference.
166
+
167
+ **Good:**
168
+ ```
169
+ matchingpose9b, a young asian woman with black hair in a ponytail,
170
+ wearing red athletic wear, studio background
171
+ ```
172
+
173
+ **Avoid (redundant pose description):**
174
+ ```
175
+ matchingpose9b, a woman squatting with hands on knees, looking up...
176
+ ```
177
+
178
+ ### 2. Use Clean Mannequin References
179
+
180
+ For best results, generate your pose reference using the companion [Mannequin LoRA](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-Mannequin). Clean, isolated mannequin images on white backgrounds give the sharpest pose transfer.
181
+
182
+ ### 3. Match Subject Gender / Age
183
+
184
+ Make sure your character description matches the body type of the mannequin reference (adult male mannequin → adult male character, female kid mannequin → young girl, etc.) to avoid proportion conflicts.
185
+
186
+ ### 4. Recommended Settings
187
+
188
+ - **LoRA Strength**: `0.9 – 1.1` — matching pose benefits from slightly stronger activation
189
+ - **Inference Steps**: 4 steps for distill and 20 steps for Base Model
190
+ - **Guidance Scale**: `1 – 4.0`
191
+
192
+ ### 5. Two-Stage Workflow for Best Results
193
+
194
+ 1. **Stage 1**: Take your real/reference photo → apply Mannequin LoRA → get clean mannequin pose
195
+ 2. **Stage 2**: Feed mannequin pose + character reference → apply MatchingPose LoRA → final output
196
+
197
+ This two-stage approach produces far better results than trying to transfer pose directly from the real reference (which carries identity bias).
198
+
199
+ ---
200
+
201
+ ## 🚀 Usage
202
+
203
+ ### ComfyUI
204
+
205
+ ```
206
+ 1. Download the .safetensors file
207
+ 2. Place in: ComfyUI/models/loras/
208
+ 3. Use the trigger word "matchingpose9b" at the start of your positive prompt
209
+ 4. Provide the mannequin pose image as the reference input
210
+ ```
211
+
212
+ ### Diffusers (Python)
213
+
214
+ ```python
215
+ from diffusers import Flux2Pipeline
216
+ import torch
217
+
218
+ pipe = Flux2Pipeline.from_pretrained(
219
+ "black-forest-labs/FLUX.2-klein-base-9B",
220
+ torch_dtype=torch.bfloat16
221
+ ).to("cuda")
222
+
223
+ pipe.load_lora_weights(
224
+ "nhathoangfoto/Flux.2-Klein-9B-MatchingPose",
225
+ adapter_name="matchingpose"
226
+ )
227
+ pipe.set_adapters(["matchingpose"], adapter_weights=[1.0])
228
+
229
+ image = pipe(
230
+ prompt="matchingpose9b, a young woman with long black hair, wearing casual clothes, studio lighting",
231
+ num_inference_steps=28,
232
+ guidance_scale=3.5,
233
+ ).images[0]
234
+ ```
235
+
236
+ ---
237
+
238
+ ## ⚠️ Limitations
239
+
240
+ - **Requires mannequin reference**: works best when paired with clean mannequin pose input. Real photos as pose reference may leak identity features into the output.
241
+ - **Extreme poses**: acrobatic or heavily contorted poses reduce transfer accuracy.
242
+ - **Face/hand detail**: faces and hands may need secondary fix passes at high resolution.
243
+ - **Multi-subject scenes**: trained primarily on single-subject images. Multi-person inputs may produce inconsistent pose matching.
244
+ - **Body proportion mismatch**: if the character description implies a significantly different body type than the mannequin (e.g., child character + adult mannequin), proportions may normalize toward the mannequin.
245
+
246
+ ---
247
+
248
+ ## 📄 License
249
+
250
+ Released under **Apache 2.0**. You are free to use this LoRA for personal, research, and commercial purposes.
251
+
252
+ The base model (FLUX.2 Klein Base 9B) has its own license — please review the [FLUX.2 Klein Base 9B license terms](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B) for base-model usage conditions.
253
+
254
+ ---
255
+
256
+ ## 🙏 Credits
257
+
258
+ - **Base Model**: [FLUX.2 Klein Base 9B](https://huggingface.co/black-forest-labs/FLUX.2-klein-base-9B) by Black Forest Labs
259
+ - **Training Framework**: [ai-toolkit](https://github.com/ostris/ai-toolkit) by [Ostris](https://ostris.com)
260
+ - **Author**: [nhathoangfoto](https://huggingface.co/nhathoangfoto) — JH AI Studio
261
+ - **Companion LoRA**: [Flux.2-Klein-9B-Mannequin](https://huggingface.co/nhathoangfoto/Flux.2-Klein-9B-Mannequin)
262
+
263
+ ---
264
+
265
+ <div align="center">
266
+
267
+ ## ☕ Enjoying this LoRA?
268
+
269
+ Your support keeps new models coming. Even a small tip makes a real difference for independent open-source AI work.
270
+
271
+ ### [**💖 Donate via PayPal**](https://paypal.me/nhathoangfoto)
272
+
273
+ [![PayPal Donate](https://img.shields.io/badge/PayPal-paypal.me%2Fnhathoangfoto-00457C?style=for-the-badge&logo=paypal&logoColor=white&labelColor=003087)](https://paypal.me/nhathoangfoto)
274
+
275
+ *Thank you for supporting independent AI research! 🙏*
276
+
277
+ ---
278
+
279
+ **If you find this LoRA useful, please ❤️ like the model and share your creations in the Community tab!**
280
+
281
+ </div>
examples/.gitkeep ADDED
File without changes
examples/1a.jpg ADDED

Git LFS Details

  • SHA256: 39176b0cb496fd0e78980321b104c627fe1ff55d5792bdbe37aeceeff4d077de
  • Pointer size: 131 Bytes
  • Size of remote file: 512 kB
examples/1b.png ADDED

Git LFS Details

  • SHA256: 0b5b57588e8a2592e350947ffda40e5209ed756944a0a5ae4d45fefcaca8026b
  • Pointer size: 132 Bytes
  • Size of remote file: 2.05 MB
examples/1c.png ADDED

Git LFS Details

  • SHA256: 77d9e7f3c84ebe298ead55a532e3b27f9ed5f848542fcf37cb349259612a6e07
  • Pointer size: 132 Bytes
  • Size of remote file: 2.19 MB
examples/2a.jpg ADDED
examples/2b.png ADDED

Git LFS Details

  • SHA256: 58c5e52180b7ec35859aad1466696d4d929e2cd485949163c85eb8a6b96b4005
  • Pointer size: 131 Bytes
  • Size of remote file: 560 kB
examples/2c.png ADDED

Git LFS Details

  • SHA256: c59ab35d5279f1374fa392b4126401c5df3baea2652eed4bf20927f4dc41e8be
  • Pointer size: 132 Bytes
  • Size of remote file: 2.11 MB
examples/Example Workflow.png ADDED

Git LFS Details

  • SHA256: 780561aec622be9edc68df6014651414f7ba8c7dde7fc4d9e10ee8f39c7af65b
  • Pointer size: 132 Bytes
  • Size of remote file: 1.19 MB