ostris / flux-dev-lora-trainer

Fine-tune FLUX.1-dev using ai-toolkit

  • Public
  • 286.2K runs
  • H100
  • GitHub
  • Weights
  • License

Blog post: Learn about training with Flux Read the blog

Create training

Trainings for this model run on Nvidia H100 GPU hardware, which costs $0.001525 per second. Upon creation, you will be redirected to the training detail page where you can monitor your training's progress, and eventually download the weights and run the trained model.

Note: versions of this model with fast booting use the hardware set by the base model they were trained from.

Getting started

You can fine-tune FLUX.1 on Replicate by just uploading some images, either on the web or via an API.

  • Select a model as your destination or create a new one by typing the name in the model selector field.
  • Next, upload the zip file containing your training data as the input_images.
  • Set up the training parameters.
    Learn more

    The trigger_word refers to the object, style or concept you are training on. Pick a string that isn’t a real word, like TOK or something related to what’s being trained, like CYBRPNK. The trigger word you specify will be associated with all images during training. Then when you run your fine-tuned model, you can include the trigger word in prompts to activate your concept.

    For steps, a good starting point is 1000.

    Leave the learning_rate, batch_size, and resolution at their default values. Leave autocaptioning enabled unless you want to provide your own captions.

    If you want to save your model on Hugging Face, enter your Hugging Face token and set the repository ID.

  • Once you’ve filled out the form, click “Create training” to begin the process of fine-tuning.
*string

Select a model on Replicate that will be the destination for the trained version. If the model does not exist, select the "Create model" option and a field will appear to enter the name of the new model. We'll create the model for you when you create the training.

*file

A zip file containing the images that will be used for training. We recommend a minimum of 10 images. If you include captions, include them as one .txt file per image, e.g. my-photo.jpg should have a caption file named my-photo.txt. If you don't include captions, you can use autocaptioning (enabled by default).

string
Shift + Return to add a new line

The trigger word refers to the object, style or concept you are training on. Pick a string that isn’t a real word, like TOK or something related to what’s being trained, like CYBRPNK. The trigger word you specify here will be associated with all images during training. Then when you use your LoRA, you can include the trigger word in prompts to help activate the LoRA.

Default: "TOK"

boolean

Automatically caption images using Llava v1.5 13B

Default: true

string
Shift + Return to add a new line

Optional: Text you want to appear at the beginning of all your generated captions; for example, ‘a photo of TOK, ’. You can include your trigger word in the prefix. Prefixes help set the right context for your captions, and the captioner will use this prefix as context.

string
Shift + Return to add a new line

Optional: Text you want to appear at the end of all your generated captions; for example, ‘ in the style of TOK’. You can include your trigger word in suffixes. Suffixes help set the right concept for your captions, and the captioner will use this suffix as context.

integer
(minimum: 3, maximum: 6000)

Number of training steps. Recommended range 500-4000

Default: 1000

integer
(minimum: 1, maximum: 128)

Higher ranks take longer to train but can capture more complex features. Caption quality is more important for higher ranks.

Default: 16

string
Shift + Return to add a new line

Hugging Face repository ID, if you'd like to upload the trained LoRA to Hugging Face. For example, lucataco/flux-dev-lora. If the given repo does not exist, a new public repo will be created.

secret

A secret has its value redacted after being sent to the model.

Hugging Face token, if you'd like to upload the trained LoRA to Hugging Face.

secret

A secret has its value redacted after being sent to the model.

Weights and Biases API key, if you'd like to log training progress to W&B.

string
Shift + Return to add a new line

Weights and Biases project name. Only applicable if wandb_api_key is set.

Default: "flux_train_replicate"

string
Shift + Return to add a new line

Newline-separated list of prompts to use when logging samples to W&B. Only applicable if wandb_api_key is set.

Including learning_rate and 12 more...