All Collections
Help Guides
How to Train Your Own Model
How to Train Your Own Model

Learn step-by-step on how to create a dataset, train your custom model and generate images

Stuart avatar
Written by Stuart
Updated over a week ago

Training your own image generation model with Leonardo.Ai opens up a world of creative possibilities. Fine-tuning allows for precise customization to your specific style or subject matter, especially useful in fields like game development and concept art. Here’s a guide to help you harness Leonardo.Ai’s model training effectively for the best results:

Key Considerations

  • Start with a well-curated image dataset that mirrors the diversity of your chosen theme, sticking to a consistent size ratio (e.g., 768 x 768px), to ensure your model can generalise effectively to new scenarios.

  • To avoid overfitting – which hampers the model's performance on unseen data –incorporate a varied dataset with up to 40 high-quality, watermark-free images to teach the model a wide array of scenarios. (Overfitting causes the trained model to recall / recreate its trained data instead of being flexible enough to adhere to the given prompt).

  • Consistency in style, format, and aspect ratio are paramount for model recognition efficiency, while introducing variation within these constraints encourages the model to creatively reapply learned elements in novel contexts. (Striking the right balance between variation and consistency may require trial and error).

Consistency - character position, style and image composition.

Variation - characters themselves and their clothes.

Bad Dataset ❌

Good Dataset ✅

By focusing on these considerations, you’re set to optimise your model training journey with Leonardo.Ai, creating customised and consistent outputs for your projects. Now let’s get started!

Step-by-Step Training Guide:

Step 1: Create a Dataset

  1. From the home page, navigate to Training & Datasets:

  2. Click on ‘Create New Dataset’ or 'New Dataset' to create your dataset.

  3. Name Your Dataset.

  4. Add Images to Your Dataset: (Remember the considerations)

  5. Images can either be uploaded or selected from previously generated images on the platform.

  6. Double check the images align with your theme or subject of interest.

Step 2: Train Your Model

  1. Fill in metadata for your model to help with categorization and retrieval. These include elements such as model name, category and prompt instance. (For clarification, prompt instance is a simple way to direct the model to properly utilise its training data framework. For example for a sketch-style model it would be something like 'A sketch of…”)

  2. When you are ready click on the 'Start Training' button.

  3. You will be notified via email once the training process is complete. (It is typically 30 minutes to 2 hours depending on complexity). When done the model will be available under Finetuned Models > Your Models.

Step 3: Generate Images

  1. Navigate to AI Image Generation > Click on the Model button and click Select Other Model. Then navigate to Your Models category.

2. Click on your newly trained model. Then click Generate with this model. Note: The image preview for the newly trained model only shows once you have done your first generation with it.

3. Type your desired prompt and generate images.

4. Observe how the generated images capture the essence of the trained images, aligning with the style and preferences of your dataset. If the results are not satisfactory, you can retrain a new model by going to Training & Datasets, choosing your dataset and selecting Edit Dataset. You will be able to delete and replace images and then train another model with the updated dataset.

ℹ️ Note: It is not possible to update an existing model that has already been trained due to technical limitations. This essentially means that every time a dataset has been modified, a new model will have to be trained to reflect the changes made.

5. Note that you can delete any models you have created by first going to Finetuned Models > Your Models. Then simply hover the cursor over the model you would like to delete and choose Settings > Delete this Model.

Final Considerations:

It is important to note that enabling Alchemy can drastically increase the quality of the generation output, depending on the model. In addition, since the training models are based on older versions of Stable Diffusion, typically detailed prompts with more quality and style modifiers will help produce better outcomes. Finally, it is important to note that you can use Elements and Image Guidance with the created fine-tuned model, just like the regular platform models.

And that does it for our in-depth Fine-tuned Model Training guide - we hope you found it useful! Remember, we're always adding new features and enhancing old ones, so be sure to check back in here from time to time to see updates or new ways of training models.

Happy Prompting! 🎨

If you have any questions or need further assistance, please reach out to Support via chat or email support@leonardo.ai

If you have large datasets and are interested in partnering on a custom model strategy for your company, please reach out to bizdev@leonardo.ai.

Did this answer your question?