type
status
date
slug
summary
tags
category
icon
password
The release of the FLUX.1 model quickly became popular around the world, generating images of higher quality than existing open source models, and supporting fine-tuning through simple operations without programming knowledge. Hundreds of public Flux fine-tunings have been published on Replicate, and thousands of private fine-tunings.
One of the most exciting features of Flux is its ability to fine-tune on facial images, something that was difficult to achieve with previous open source image generation models like Stable Diffusion or SDXL. Since Dreambooth, it has never been easier to fine-tune to get great results from just a few training images.
This article details how to use your own photos on the Replicate platform to fine-tune the FLUX.1 image training model, so that you can use your own photos to generate new images of various styles, such as superheroes, cartoon characters, or adventurers.
Key Steps of Training FLUX.1
Prepare training images
at least 10 high-quality facial photos taken from different angles and lighting conditions.
- Select Trigger Word: Create a unique "trigger word" that will be used to activate the model later in the prompt text.
- Create and train the model: Upload images and trigger words on Replicate for training, which takes about 20 minutes.
- Generate images: Use the trained model to generate detailed description text containing trigger words to generate images related to the prompt.
Step 0: Preparation
Before you start fine-tuning your FLUX.1 model, you will need the following:
- A Replicate account
- A few photos of yourself as training pictures
- $2-3 to cover model training costs
Step 1: Collect training images
You will need to collect several photos of yourself for training. It is best to use photos from different angles, lighting conditions, and backgrounds. It is recommended to have at least 10 high-quality facial photos , but at least 2 are required.
Image requirements:
- Supported formats: WebP, JPG, PNG
- Resolution: 1024×1024 or higher is recommended
- File name: You can name it as you like. The file name does not affect the training.
- Aspect ratio: Images can be square, landscape, or portrait
- It is recommended to have at least 10 pictures. The more pictures, the better the effect.
- Choose a variety of pictures, such as different backgrounds, clothing, lighting, angles, etc.
Preparation steps:
- Store the images in a folder named, for example
data
.
- Compress the folder into
.zip
a file nameddata.zip
.
Step 2: Choose a unique trigger word
When fine-tuning the FLUX.1 model, you need to select a unique trigger word that will be used later in the image generation prompt text.
Trigger word requirements:
- When choosing trigger words, keep the following in mind:
- It should be unique, i.e.
MY_UNIQ_TRGGR
- It should not be an existing word in any language, such as
dog
orcyberpunk
- Don't use
TOK
combine it with other tweaks . - Capitalization doesn’t matter, but capital letters can help you differentiate your trigger words from the rest of the text in your prompt.
think "vanity license plate", but of any length.
.
because it will conflict if you want to
For my Zeke/Ziki-Flux spin, I chose
ZIKI
as the trigger word. Short, unique, and easy to remember.Have you decided on a trigger word? Remember it, you’ll need it in the next step.
For example, the author used "ZIKI" as the trigger word in the example, and you can choose a similar unique character combination according to your preferences.
Step 3: Create and train the model
Next, you will upload the training images on the Replicate platform and start training the model. You can choose to use the web form for training, or automate the process through the API.
Web page training steps:
- Visit the Flux tuning form.
- Choose where to publish the model: You can choose to publish the fine-tuned model as public or private.
- Upload training images: In
input_images
field, upload the compressed package created previouslydata.zip
.
- Enter Trigger Word: In
trigger_word
field, enter the unique trigger word you selected previously.
- Select the number of training steps: The default setting is 1000 steps. Fewer steps may not be able to learn the concepts in the image well, while more than 1000 steps may be a waste of time and cost.
- Click Create training to start training.
Step 4: Wait for training to complete
The training process is pretty fast, but still takes a few minutes. If you use ten images and 1000 steps, the whole process should take about 20 minutes. Use this time to get up from your computer, stretch your arms and legs, drink some water, etc.
When you come back, your model should be ready.
Step 5: Generate an image using a web page
Once training is complete, your fine-tuned model is ready to use. Enter the prompt sentence through the web form to generate an image.
- Visit the Replicate platform web playground.
- Enter the prompt: Include the trigger word you set previously in the prompt. For example:
"photo of ZIKI looking super-cool, riding a segway scooter"
The FLUX model works better with detailed prompts, so provide as much specific as possible.
Step 6: Generate an image using the API
If you don't want to manually enter the prompts on the web page to generate images every time, you can use Replicate's API to automate the generation process.
The Web Playground is a great place to start playing with your new model, but generating an image with every click can quickly become tiresome. Fortunately, your model is also hosted in the cloud and provides an API, so you can run it from code in the programming language of your choice.
When you run the model, you’ll see tabs for different languages, such as Node.js and Python. These tabs contain code snippets that show you how to construct the API call to replicate the exact parameters you just entered into the browser form.
Click the Node.js tab in the web playground to view the API code:
API code examples: You can find API code examples in different languages in the web playground, such as Python or Node.js. Here is a simplified Node.js code example:
With this API, you can generate images from your own programs.
Step 7: Generate better prompts using LLM
Sometimes, you may have difficulty coming up with a suitable prompt to generate an image. In such cases, you can use a language model to generate detailed prompts.
Prompt generation example: Use LLM to generate detailed prompts such as the following:
This generates some interesting prompt:
To get started writing your own prompts, check out Meta Llama 3.1 405b , a fast and powerful language model that you can use on the web or through the API like your own models:
Step 8: Iterate and share results
Now that you have a fine-tuned image generation model and a language model to help generate prompt words, it’s time to start playing around and generating interesting images.
If you need inspiration, check out the Flux Tweaks collection on Replicate to see what others have created.
By following the above steps, you can successfully fine-tune the FLUX.1 model and generate personalized images. If you encounter any problems, you can refer to Replicate's support page for help.
- Author:KCGOD
- URL:https://kcgod.com/train-FLUX.1-without-coding
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts
Google Launches Gemini-Powered Vids App for AI Video Creation
FLUX 1.1 Pro Ultra: Revolutionary AI Image Generator with 4MP Resolution
X-Portrait 2: ByteDance's Revolutionary AI Animation Tool for Cross-Style Expression Transfer
8 Best AI Video Generators Your YouTube Channel Needs
Meta AI’s Orion AR Glasses: Smart AI-Driven Tech to Replace Smartphones