Install
openclaw skills install lora-finetuneLoRA fine-tuning pipeline for Stable Diffusion on Apple Silicon — dataset prep, training, evaluation with LLM-as-judge scoring. Use when fine-tuning image ge...
openclaw skills install lora-finetuneTrain custom LoRA adapters for Stable Diffusion 1.5 on Mac hardware. Tested on M4 24GB — produces 3.1MB weight files in ~15 minutes at 500 steps.
| Config | Model | Resolution | VRAM |
|---|---|---|---|
| M4 24GB | SD 1.5 | 512×512 | ✅ Works |
| M4 24GB | SDXL | 512×512 | ⚠️ Tight, may OOM |
| M4 24GB | FLUX.1-schnell | Any | ❌ OOMs |
| M4 Pro 48GB | SDXL | 1024×1024 | ✅ Estimated |
# Prepare training images in a folder
ls training_data/
# image_001.png image_001.txt image_002.png image_002.txt ...
# Train (see scripts/train_lora.py for full options)
python3 scripts/train_lora.py \
--data_dir ./training_data \
--output_dir ./lora_weights \
--steps 500 \
--lr 1e-4 \
--rank 4
# Compare base model vs LoRA vs commercial (Gemini/DALL-E)
# Pixtral Large scores each image 1-10 on:
# - Style consistency with training data
# - Image quality and coherence
# - Prompt adherence
# Our results: Base 6.8 → LoRA 9.0 → Gemini 9.5
# Lesson: Gemini wins without training, but LoRA closes the gap significantly
scripts/train_lora.py — Training script with Apple Silicon MPS supportscripts/compare_models.py — LLM-as-judge evaluation comparing base vs LoRA vs reference