File size: 2,022 Bytes
0f9a690
 
 
 
 
 
 
 
 
7b29017
 
 
 
 
20dd25c
0f9a690
 
 
 
 
 
 
 
 
 
 
 
d677e94
0f9a690
 
 
fbb8b7d
0f9a690
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
license: apache-2.0
datasets:
- nbeerbower/FIXBODY
base_model:
- Qwen/Qwen-Image-Edit
tags:
- lora
---

![image/png](https://huggingface.co/nbeerbower/FIXBODY-r64-Qwen-Image-Edit/resolve/main/r64_example.png?download=true)

# FIXBODY-r64

An imperfect LoRA for Qwen-Image-Edit focused on correcting hands and anatomy issues in anime-style illustrations while preserving the original art style.

I am working on an improved version of this LoRA!

## Usage

```
pipeline.load_lora_weights(
    "nbeerbower/FIXBODY-r64-Qwen-Image-Edit",
    weight_name="pytorch_lora_weights.safetensors"
)
```

Triggered by `fix [her/his/their] hands/legs` (the pronoun can be omitted, and it works best focusing on one body part at a time)

## Model Configuration

[Training code available on Github!](https://github.com/nbeerbower/Qwen-Image-Edit-LoRA-Trainer)

```
# Configuration for FIXBODY - 86 high-quality pairs

# Model settings
pretrained_model_name_or_path: "Qwen/Qwen-Image-Edit"

# Dataset settings
dataset_name: "nbeerbower/FIXBODY"
dataset_split: "train"
max_samples: null  # Use all 86

# Prompt settings
use_prompt_directly: true
prompt_template: "{prompt}"

# LoRA configuration
lora_rank: 64
lora_alpha: 128
lora_dropout: 0.01
target_modules: ["to_k", "to_q", "to_v", "to_out.0", "ff.net.0.proj", "ff.net.2"]

# Training settings
train_batch_size: 1
gradient_accumulation_steps: 2
num_train_epochs: 50
max_train_steps: 3000
learning_rate: 1e-4
lr_scheduler: "cosine"
lr_warmup_steps: 50

# Optimizer settings
use_8bit_adam: true
adam_beta1: 0.9
adam_beta2: 0.999
adam_weight_decay: 0.001
adam_epsilon: 1e-8
max_grad_norm: 1.0

# Mixed precision
mixed_precision: "bf16"

# Checkpointing and logging
output_dir: "./output_fixbody_full2"
logging_dir: "logs"
checkpointing_steps: 100
checkpoints_total_limit: 15
report_to: "wandb"
tracker_project_name: "qwen-fixbody"
run_name: "r64-1e4-50ep-0.01ld"

# Data processing
save_embeddings: true
dataloader_num_workers: 1

# Memory optimization
gradient_checkpointing: true
```