How replicate/flux-fine-tuner works
flux-fine-tuner provides Cog-based FLUX LoRA training and inference. The training workflow accepts images and configuration, optionally captions the images, configures and runs ai-toolkit training, then returns weights and can upload them to Hugging Face or log training activity to Weights & Biases. Inference loads model pipelines, resolves and caches LoRA weights, generates or edits images, and applies safety checks. The README documents these major capabilities; some connections are supported only by its statements or the sampled excerpts.
Main entry points: train.py Training API · predict.py Inference API · ai-toolkit Training job · wandb_client.py W&B logging
Components 17
LoRA training
- Training API
train.py - Image dataset
train.py - Training job
ai-toolkit - Trained LoRA
train.py
Training support
- Auto-captioner
caption.py - Layer selection
layer_match.py - Runtime patches
submodule_patches.py - W&B logging
wandb_client.py
Image inference
- Inference API
predict.py - FLUX pipelines
predict.py - Generated images
predict.py
Inference support
- Weight download cache
weights.py - LoRA loader patch
lora_loading_patch.py - Safety checks
predict.py
Other components
- Model user
- Hugging Face
- Replicate
Connections 20
- Model user → Training API: submits training
README.md - Training API → Image dataset: extracts images
train.py - Training API → Auto-captioner: captions images
train.py - Training API → Layer selection: selects layers
train.py - Training API → Training job: runs job
train.py - Training API → Runtime patches: applies patches
train.py - Training job → Image dataset: trains on
- Training job → Trained LoRA: saves weights
- Training API → W&B logging: logs training
train.py - W&B logging → Trained LoRA: saves weights
wandb_client.py - Training API → Hugging Face: optionally uploads
README.md - Training API → Model user: returns weights
train.py - Model user → Inference API: requests generation
README.md - Inference API → Weight download cache: ensures weights
predict.py - Inference API → FLUX pipelines: selects pipeline
predict.py - Inference API → LoRA loader patch: patches loading
predict.py - Inference API → Safety checks: checks images
predict.py - Inference API → Generated images: returns images
predict.py - Inference API → Replicate: serves predictions
- Generated images → Model user: delivers images
README.md