Transcript for:
Fine-Tuning Flux for Custom AI Models

My name is David Andre and here is how to fine-tune Flux for your specific use case. Now you must learn this skill because the demand for custom AI image models is about to explode. Every single company and influencer will need their own custom LoRa in the next two to three years. So those who can create them will make a killing. So in this video you learn how to fine-tune Flux even if you're a beginner. Now Flux created a whole revolution in the AI industry. The outputs look super realistic, way more realistic than Midjourney or DALI. It accurately follows the prompts and most importantly, it's open source. And yes, it can even generate fingers. Now, what even is a LoRa, right? LoRa stands for low-rank adaptation. And it's a method for fine-tuning AI models like Flux. So instead of adjusting all of the billions of parameters, it focuses on small targeted updates that make the biggest difference. Now, this is where I think the real opportunity lies with physical products. Companies that sell physical products will pay big money to have their own LoRas. Why? Because you can't put a chair on the moon. Creative advertising always wins. And with these AI models, you can imagine essentially anything. So at the end of this video, I'll show you where to find clients and how to actually sell this. Now, if you're serious about making money with AI, you should join your society. Inside, you get hands-on help from me and my team. You literally get 30 calls per month where you can ask me anything. I also give you the complete AI agent I built and tell you exactly how to sell it. All you need to do is take action. And if you join in August, you'll get a personalized plan to make your first dollars with AI. So don't miss this opportunity and make sure to join. It's the first link in the description. Now it's time to build our own LoRa. The first step is go to replicate.com. Once you're here, log into your account or create a new one. It takes 20 seconds. Then click into the search bar and type Flux Dev LoRa Trainer. And you want to click on the model by Ostris. This one. Flux Dev LoRa Trainer. Click on that and this is the project that will let us train our own LoRa. So if you scroll down a bit you'll see the form which is the easiest way to do this right. So the first thing we have to do is to select our destination model which is where the finished train version will be saved. So click on that and click on create new model. I'm just going to name it AI glasses because that's what I will be building. Now if we scroll down further you can see the next field is for input images which is where we put our training data our data set. Now this is perhaps the most important part because if you put in shitty images you'll get shitty results right. Garbage in garbage out. So make sure to put in quality images. As you can see they recommend at least 10. I recommend at least 20 because it will yield better results. Let's start by creating an empty folder where we will store our data set. I'm just going to name it AI glasses and the next thing we need is obviously the images, right? So if you're making a model of yourself, you need quality images of your face and also some full body pictures as well. If you're doing it for a product, then you need to go to Google and find that product. So I'm doing it for meta AI glasses. So that's what I will search up. Then go to images and basically any company you're doing this for, any company that has a physical product will have plenty of images available that you can train the model on. So if you have a bit of creativity you can literally copy what I do in this video and pitch it to companies and sell it for thousands of dollars. I mean sunglasses alone have like tens of thousands of companies that sell sunglasses. So if you just do the steps I'm doing in this video you will have a skill that is worth multiple figures. So the secret to building a great data set is variety. You want to pick a large variety of images. So let's say this one right. I'm gonna do open image in new tab that way I have the best resolution. And then I'm going to take a screenshot of the part that clearly shows the product. Boom. One. Done. And what you can do is actually you can use sites like ClickCounter to just keep count of how many you have, right? So there is one. Let's see. Then I can maybe use this one, right? This is a product photo. It's not a person, which is good variety. So I definitely want to keep that variety. So let me open the image as well. And the more variety, the better. Because you are training on the product, not on the person or environment, right? So for example, if you are doing... Photos of yourself right and you wear the same t-shirt in every single image You will train the model on that t-shirt as well. Not just on your face So you want to keep the one constant which in this case is the sunglasses the same and change everything else from image to image So this could be a good image, right because it's a different angle and a different person than what I did before So let me also Screenshot the part of the glasses. Okay, that's the third one then I could do another just photo of the product in the hand. This is really good. This is very different from what I had before Although the resolution is quite bad. Just keep in mind resolution also matters. So try to go for stuff that's more high res This is better for sure. So let's screenshot this as well Okay, that's another one and you get the point you do this until you have 20 to 30 high quality images from different angles inside outside different lighting once you have the 20 images put them all into a single folder and Now we have to rename them and choose some arbitrary made up string which we will use to call or call on the model so that it knows what we're calling so basically as you can see all of these are named pretty much the same you can do this manually or you can just you know select all rename and then put the part you want to replace so in this case i want to replace screenshot and then i'm going to do a photo this should be the naming a photo of and then you want to put in a random string that doesn't represent any word so i can do like ai glasses right like this full caps and full together. So let's do that, rename. As you can see everything has been renamed to this single format. A photo of AI glasses full caps, right? Beautiful. Now what we need to do is we need to zip the folder so that we can upload it into Replicate. So first I'm gonna just rename it. This isn't necessary but it's good for organization. Photos of AI glasses. Okay, then I'm gonna zip it on macOS it's compressed. On Windows you have to create a zip folder and then drag. the normal one into the zip right so once you have the zip folder you can drag it into the input images field okay amazing also you can include captions if you want uh to have control over you know what is described you would what you would do is in the folder you would create a caption file a txt file for every image file this is if you really want to have more control but it is not necessary so okay then this is the trigger word this is what we basically chose right so for us it's all gonna be ai glasses As they say, pick a string that isn't a real word like talk or something related to what's being trained like cyberpunk. The trigger word you specify here will be associated with all images during training. Okay, so let's scroll down. Auto caption, obviously, since I didn't provide captions, we have to keep this checked in. And prefix, this is optional, but I like to do it. And simply, you know, to give more context for the model. Because the captions are going to be generated using lava. And they're not going to include our... trigger word you know they're not going to include ai glasses so i want to configure the prefix to say a photo of ai glasses space so that this is put at the start of every single caption so that the model is trained with like knowing that ai glasses are the thing in every picture right since this will be at the start of every description suffix we can skip this um honestly steps so this is interesting if you want a really good model you should do 2000 3000 if you want just do it for the first time 1000 is fine because it will still yield very impressive results but obviously if you put it to 2000 the training will take twice as long and cost twice as much but 1000 is a good starter place if you really care about quality put it to 2000 you can we can skip these skip this don't worry about this um laura rank again this could be increased you could do 32 but honestly 16 is plenty From my experience, again if you care about quality try 32 or 64, but as they say it will take longer to train. Scroll down, skip this, now Hugging Face repo id. This is where we need to use Hugging Face, which is where we will store the complete model, so that we can access it when running it. So go to HuggingFace.co. If you don't have a Hugging Face account yet, make sure to create one, it's super easy. Once you have one, click on top right on your profile icon and click on new model. This is going to be our model repository. I'm just going to name it AI glasses. Keep it simple. You can skip the license. Make sure it's public. This is important. Make sure it's public and then click on create model. Now what you need to do is click on this button, this copy button. Copy this copies the entire thing. Go back to replicate and paste it in here. Now as you can see the next field requires a Hugging Face token. So let's go back to Hugging Face. Click on the profile picture again. This time go to settings, then on the left click on access tokens. And this is basically like an API key but for Hugging Face. So click on create new token. Let's give it a name, I'm going to give it AI glasses. And then permissions, just you know click everything under repositories, everything under inference, webhooks, collections. And this is the most important part, repositories permissions. So in here we have to find our new repository that we just created. So this is the new one, AI glasses. Click this and give it everything. Related to this repository that way Replicate can use this access token to save the model into our repository Okay, create token and copy it click on done head back to replicate and just control V Boom we can skip this last field and all that remains is to click on create training and now we've officially Started the training process if you are getting error what you might try is go to hugging face type flux dev Click on Black Forest Labs Flux Dev and request access. Right, so as you can see you have been granted access to the model. If you didn't, if I didn't click this there would be like a button request access. Just click that just in case. As you can see it is training already so luckily I didn't have to wait in any queue. And these are the steps since we did 1000 steps if you remember right here. So it is going and yeah right now it seems like it will take around 20 minutes. Which is pretty pretty solid. So as you can see we are at 99 100 percent. So we're about to finish the training. We are uploading to HuggingFace and boom the training was successful. Amazing. So by the way of course I'll link you know the replicate project and everything else you need below the video. But let's take a look at it. Now if we go into HuggingFace. If we click on my profile. Then under models select the repo we created. Which in this case is AI glasses. And if you click on files, you'll see a bunch of stuff has appeared, right? One minute ago. So this is the model readme file. And in the model card, we can actually see stuff, right? And we can even see the link to where to train it. And you can even run it in here, right? But the proper way to run it is in replicate. So when you finish training, you have literally this button right here, run trained models. So click on that. Before we test it out, I need to say one more thing. There is a chance your training run was not successful. There is a chance you're getting errors. with replicate either before the training starts or during training and it is very likely that it is because you haven't connected your credit card. So if you click on profile and click on account settings on the left click on billing and make sure to put in your credit card here. The training of the model itself will take like $2 but then when you run the model it will take like I think $0.1 per image. So in order to prevent running into any errors definitely put in your card there. Don't be cheap. Again, it costs $2 to train the model. Okay, so now we can finally test it out. So here we have the finished model, finished fine-tune, our own LoRa. And as you can see, we can set in prompt, aspect ratio, width and height. Most of these you can ignore, but obviously the prompt is the main one. So we want to use the same trigger word as we trained on. In this case, it's AI glasses. And we can put like AI glasses worn by a male model, you know, sunset. Fashion model, whatever. Okay, then aspect ratio. Let's try like four or five It's like an Instagram photo number of outputs here You can create said like how many images you want to create obviously will take longer time to generate Then Laura scale just leave this as is most of these you can leave as this number of inference steps You can play around with it. I wouldn't go below 28, but from my experience, honestly It doesn't really improve the quality that much. So I like to just keep it like 28 to 32 Yeah That's at least my experience. Model. Here you can use the Schnell, which is much cheaper, but also worse quality. And it's faster. So if you are tight on budget, you can generate with Schnell. But honestly, I would highly recommend Dev because it's much better. And we can skip these, skip these. Seed. This you can use actually. There's a creative strategy that I realized only yesterday. Once you're getting good results, right? Something that looks like the product or looks like you. You can copy the seed. You can save the seed and just... change around the prompt and play with the prompt so that's interesting tip and here you can actually use an extra laura which means if you train two different lauras let's say one on yourself and one on a product you can use the other laura so that you have images ai images of yourself wearing that product and also you can set an influence how much the second model influences the outputs output format i'm just going to do png i hate webp output quality um It's not relevant for PNG outputs, but you know just do 80 or 100 doesn't matter. But as you can see most of these parameters you can just leave empty. What matters is the prompt, aspect ratio, obviously number of outputs, how many images you want generate and yeah the rest you can you're good to just leaving that default and let's hit run and let's see how our own Flux LoRa looks. Also another benefit of using this replicate project over other ones is because since it uses the H100 GPU Generating the images will be much faster than other projects that use A100. And boom! Look at this! Amazing, right? So it did follow, we have the AI glasses right as you can see these are the cameras. This is the Ray-Ban logo. It is worn by a male model at sunset and yeah, I mean look this is amazing image. Looks realistic and this could easily be used in an ad. Let's try one more image. Let's do AI glasses in front of a white background. Now to be honest it usually takes like 10-20 images to get something really impressive. Maybe this time we just got lucky and got something, you know, really good on the first try. But again, okay, this is also good. So yeah, it is the AI glasses. As you can see, we have the two cameras. We have the Ray-Ban logo. Now, as I promised, let's look at how to actually make money with this. There are two main target avatars I see. SMBs, which stands for small to medium-sized businesses with physical products, right? So again, sunglasses, any type of fashion, any type of furniture. Real estate stuff, like selling real estate apartments, Airbnbs, I mean, the amount of physical product, anything that's selling a physical product will need this, sooner or later, right? And the second target avatar is influencers, obviously. Now, the way to sell this is very simple. You take the price, the cost of hiring a photographer, studios, travel, human models, and you compare that to what you charge. So, on the left, this can be... Tens of thousands of dollars or even more. On the right, you can do like, you know, one-time fee of like $2,000, $3,000. Or you can do a subscription, smaller, let's say like $500 a month, where you're delivering images constantly to them, depending on the deal and depending on the budget of your potential client. But just to give you a real story, Sean, a member of the New Society, has a high-end fashion brand, right? Luxury fashion brand for women. He used to spend $180,000 for a single photo shoot. Included as I said travel all the clothing new clothing to test models photographers all of that right 180k now He's training multiple AI models and obviously he's not spending anywhere near that and he's getting amazing results I mean literally indistinguishable things. This is this is what people don't get It's not like the product looks different if you do it correctly if you have enough images in the data set Let's say 50 100 quality images and you do 2,000, 3,000, 4,000 steps, and you increase the LoRaRank to like 32 or 64, you can get really amazing results where the product actually looks like the real thing. And for anybody who's selling a physical thing, this is absolutely a must do. And again, most companies will not do this because they don't have the skills, they don't have the time, or they simply don't know it's possible. So if you can learn this skill, like the opportunity is enormous. Now, where do you actually find the clients, right? Because this is probably... The question that's popping in your head right now. Well, method one. There's two methods I would do personally. Method one is Instagram or Facebook. Companies that are already running ads. So either the ads that are recommended to you, what you can do is actually create a new account. That way it's fresh and only follow pages or companies with physical product. So as I said, you know, it could be fashion. Like fashion is huge, obviously, because they care about the looks. But it could be anything else like backpacks. I mean... Look at the physical products you own. Somebody had to make them and somebody had to sell them, right? So just probably create a new Instagram account or new Facebook account and follow only the pages that do these products so that you get ads recommended to you from the companies that are already running ads, which tells you two things, right? They have money because they're running ads. And second, they understand the value of good images, good creatives, because they're already actively advertising. So that would be the method number one. The second method would be to pick a product type, right? So again, you can probably choose sunglasses, do exactly what I did in this video and sell it to different sunglass companies. Like I don't mind, I would be more than happy for you to guys just copy what I did and sell it to other companies because there is literally, as I said, tens of thousands of sunglasses companies alone and then you have hats, t-shirts, different fashion brands, phone cases, I mean so many potential things where you know the physical product needs to be sold. So in this second method you would pick one. You would create case studies, meaning exactly what we did, with like three to four different brands, and you would use that as proof, showing the company you already did it with some of their competitors, you know. They would feel like, oh no, like other competing sunglasses brands are already doing it, I better get on it. The main thing is to focus on, in this method, to focus on one product type, and then message every company in that niche, and build a reputation that you are expert at, you know, creating models for t-shirts or, you know, whatever, phone cases, right? Doesn't matter. But you would be hyper focused on one type of product and you know know everything about it And then you would target you basically message every single company that exists in that niche And try to work with any as many of them as possible So here is the four step plan so you can actually start doing stuff, right? Number one opening message You simply say hey, is this the best way to reach you simple message, right? Once they are responding you send them a quick loom just one to two minute video of yourself on their website or on their Instagram talking about what you would do and then also showing them the pre-trained AI models you did either for their brand or for somebody else right but the step three is once they're showing interest you make them the model for free and you don't give it to them you simply make it and see like look this is you know these are your sunglasses and you show them like 10 amazing pictures now to get 10 amazing pictures you want to generate at least 100 200 300 images yourself and choose the best 10 don't just send them the first 10 you have right So once they're showing interest and once you show them like, look, I already made the fine-tuned LoRa. Obviously, you don't use this term because the companies don't care what AI model used, you know, what type of training, fine-tuning. They don't care. They care about what they will get. So don't talk about, you know, Flux 1 LoRa. Talk about what they will get. So once they're showing interest and once they see that you've made the model for their own physical product, the last step is to sell it, which at that point, it becomes very easy because they see you can do it. They see you've done it for others and they see you've already done it for themselves. So they know that they will get what they're paying for, right? So if you like give them the complete model, obviously that's going to be more of a one-time payment. As I said, try to go for like $3,000 or higher. If you want to do it more like a recurring membership, you know, where you give them new creatives, new photos of the product because they don't want to generate it themselves, let's say. Then you can do like, you know, I'll give you 20 amazing images every single week and I'll charge you. 700 bucks a month. That would be really fair and a lot of Shopify e-commerce stores would agree to this ASAP. Now here is why you should join the new society. The easiest way to make money with AI is to surround yourself with people who already do. Inside of the new society I will show you step by step how to make your first thousand dollars with AI. And by the way if you don't find it valuable I will personally send you the money back. No questions asked. So if you want to make money with AI make sure to join. It's the first link in the description. Thank you for watching.