--- 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-r128 An imperfect LoRA for Qwen-Image-Edit focused on correcting hands and anatomy issues in anime-style illustrations while preserving the original art style. This is a longer more aggressive training of the LoRA, as I noticed it had not yet overfit to training data. ## Usage ``` pipeline.load_lora_weights( "nbeerbower/FIXBODY-r128-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) ``` # Aggressive Configuration for FIXBODY - 86 samples # Model settings pretrained_model_name_or_path: "Qwen/Qwen-Image-Edit" # Dataset settings dataset_name: "nbeerbower/FIXBODY" dataset_split: "train" max_samples: null # Prompt settings use_prompt_directly: true prompt_template: "{prompt}" # LoRA configuration - MAX CAPACITY lora_rank: 128 # Maximum practical rank lora_alpha: 256 # 2x rank lora_dropout: 0.0 # No dropout - let it fit target_modules: ["to_k", "to_q", "to_v", "to_out.0", "ff.net.0.proj", "ff.net.2"] # Training settings - AGGRESSIVE train_batch_size: 1 gradient_accumulation_steps: 1 # Update every sample num_train_epochs: 100 # Many epochs to really learn max_train_steps: 10000 learning_rate: 1.5e-4 # Higher LR lr_scheduler: "constant" # No decay lr_warmup_steps: 20 # Optimizer settings use_8bit_adam: true adam_beta1: 0.9 adam_beta2: 0.999 adam_weight_decay: 0.0001 # Minimal weight decay adam_epsilon: 1e-8 max_grad_norm: 1.0 # Mixed precision mixed_precision: "bf16" # Checkpointing and logging output_dir: "./output_fixbody_aggressive" logging_dir: "logs" checkpointing_steps: 300 # Frequent checkpoints checkpoints_total_limit: 30 # Keep many report_to: "wandb" tracker_project_name: "qwen-fixbody" run_name: "r128-aggressive-100ep" # Data processing save_embeddings: true dataloader_num_workers: 1 # Memory optimization gradient_checkpointing: true ```