• AInauten.net
  • Posts
  • 🀳 Train your own image AI (e.g. of yourself)

🀳 Train your own image AI (e.g. of yourself)

PLUS: Use multiple trained image AIs (LoRAs) at the same time

This issue is brought to you by:

Hello AInauts,

Welcome to the new issue of your favorite newsletter. Today with an experiment: an in-depth hands-on learning experience.

We show you how to train your own AI image model. Train an AI model for yourself - no need to travel for great Instagram shots. πŸ˜‰

Here is the agenda for today:

  • 🀳 Deep Dive: Train your own image AI

  • 🀯 Use multiple trained image AIs (LoRAs) together

Please let us know if you like this kind of tutorial once in a while, or if you prefer just news and updates from the world of AI.

Here we go!

🀳 Deep Dive: Train your own image AI

For a few weeks now, the internet has been full of hype about the new Image AI FLUX, made in Germany. We have already written about it several times.

FLUX makes everything so much easier. And provides incredibly good quality.

In this tutorial, we show you an example which was previously only feasible for techies. But now, it can be done by anyone:

We train our own image AI that always creates images of the same person - for less than 5 dollars, without subscription tools!

Why is this useful?

Such trained models are called LoRAs. And if you're wondering why the hell this is exciting, here are a few reasons:

1) You always want to create images with the same person

This is ideal, for example, if you want to run an AI influencer account. Or you want to create images of yourself in places or situations you've never been.

2) You want to create images in a certain style that should always look the same

It is also super practical if you want to create coherent comics or if you need characters in the same style.

You can use LoRAs to make sure your images stay consistent with the person or style you want.

You may be familiar with websites like HeadshotPro and PhotoAI. Their founders earn millions and basically use the very same technology.

Step 1: You need the following tools

To train your own LoRA based on FLUX, you essentially need two platforms. Simply create free accounts:

(There is also another popular platform called Fal, but we picked Replicate for this example).

Step 2: Collect 12 images of your person or the desired style

In our specific use case, we create a LoRA for our AInauten influencer. May we introduce: AIlexa

If you want to create a LoRA of yourself, simply put together at least 12 photos of yourself.

In the next step, name the 12 pictures in the format: a_photo_of_PLACEHOLDER

In our case, all images are named: a_photo_of_Allexa

This is what our folder looks like. As you can see, it is a broad selection of images.

The naming is important, however, because your LoRA will understand this later when you write in the prompt: "Create a picture of AIlexa..."

The last step in the preparation is to create a ZIP-file of all your images.

Step 3: Set up Hugging Face model and token

We will now use Hugging Face to access the image models. To do this, please do the following:

1) Create an access token

To do this, go to "Settings" in your account and then to "Access Tokens".

Give your token a name and the rights as shown in the picture above. There are probably too many boxes checked, but it works. πŸ˜‰

Save the token - we'll need it in a minute for Replicate.

2) Create a model repository

The next step is to create a folder for our model. Go to your profile and click on "New Model".

Here you give your model a descriptive name - in our case, for example, ailexa-lora. Set the model to Public here, otherwise Replicate will not work later on.

Step 4: Train your LoRA

Now it's time to train with Replicate.

Click here and open the AI Training Toolkit. Click on the "Train" tab.

The training is not entirely free. We use an Nvidia A100 chip from Replicate, and of course that costs something.

$0.0014 per second to be precise. This means that a trained model costs you between 2 and 5 euros.

Quite reasonable, we think.

Now it's time to fill in the training screen. This is also simple, we leave most of the values set to default. Here in detail:

If you want to use your model later via Replicate, select the Creating New Model entry under destination.

Under images, upload your ZIP-file with images.

In the field hf_token, enter your Hugging Face Token, which we have previously created.

For the repo_id, you enter the path of your model, which we have previously created in Hugging Face.

It always has the following format: yourUserName/yourModelName

You can leave all other values in the default state for now.

And that's it! Let’s start the training.

You’ll see in Replicate once the training is complete. In our Allexa case, this took 38 minutes and the cost was $3 USD.

Step 5: Use your LoRA

The easiest way to use your LoRA now is again via a model on Replicate.

Step 1: Get your LoRA path from Hugging Face

To do this, simply click on the model you have previously created and copy the path.

Now create a prompt using the name you defined for your LoRA. In our example, we want a picture of AIlexa:

You can leave the remaining values as default. You only need to add your LoRA with the hugging face path from step 1 in hf_lora

And the result of the prompt from above?

Here is our influencer AIlexa once again as a speaker at an innovation conference:

After the work was done, AIlexa first went out and about to Paris:

Alright, that’s it! We hope you liked it and it makes you want to try it out.

It really is incredible what we can now do with AI without any technical skills and for less than $5 dollars.

As always, please get in touch if you have any questions.

🀯 Use multiple trained image AIs (LoRAs) together

And for those who want even more: You have the option of using several specially trained LoRAs (or LoRAs provided by others) at once.

To do this, use this replicate model.

It allows you to add up to 20 different LoRAs, e.g. from Hugging Face and Co.

Simply add each one individually, just as we have already added your own above. The cool thing here is that you can then connect your personal LoRA with a style LoRA, for example.

Here is a "knitted" person:

That's it! Something a little different from usual today - please give us feedback on whether this was relevant and interesting for you, or whether you would prefer more news and co.

Thank you for joining us.

Reto & Fabian from the AInauts

P.S.: Follow us on social media - that motivates us to keep going 😁!
Twitter, LinkedIn, Facebook, Insta, YouTube, TikTok

Your feedback is essential for us. We read EVERY comment and feedback, just respond to this email. Tell us what was (not) good and what is interesting for YOU.

🌠 Please rate this issue:

Your feedback is our rocket fuel - to the moon and beyond!

Login or Subscribe to participate in polls.