
Train a Custom Style (LoRA)
Train a custom style using your own images to generate AI art with consistent visual aesthetics.Train a Custom Style (LoRA)
Train a custom style using your own images to generate AI art with consistent visual aesthetics.Overview
LoRA (Low-Rank Adaptation) is a fine-tuning technique that teaches an AI model a new visual style using a small set of example images. It works by injecting new “style weights” into an existing model, making training both fast and efficient. This guide walks through the complete workflow:Prepare Training Images
Curate and upload high-quality images that represent your desired style
Submit Training Job
Send a POST request to
/styles/train with your image URLs and configurationMonitor Progress
Track your training job status using the returned
job_idGenerate with Your Style
Apply your trained style to image generation
Prepare Training Images
Curating Your Dataset
The quality of your training images directly impacts results. Different training types have different requirements:| Type | Use Case | Tips |
|---|---|---|
| Style | Artistic styles, visual aesthetics | Consistent style across varied subjects |
| Character | Personal likeness, consistent characters | Varied poses, expressions, lighting |
| Object | Specific items, products | Multiple angles, consistent object |
How Many Images?
Quality matters far more than quantity. A small set of excellent images will outperform a large set of mediocre ones.| Dataset Size | Guidance |
|---|---|
| 5 images | Minimum viable. Can work for simple, consistent styles |
| 10-30 images | Recommended. Best balance of quality and coverage |
| 50+ images | Diminishing returns unless style has high variation |
Example Datasets
- Character training: Photos of a person with varied poses, expressions, and lighting conditions. Avoid including other people in the images.
- Style training: A collection of artwork in a consistent style. For example, The Metropolitan Museum of Art Ukiyo-E Dataset provides Japanese woodblock prints ideal for training an artistic style.
Upload Images
Before training, upload your images to get hosted URLs. Use the/assets endpoint:
Train Your Style
Basic Training Example
Submit your image URLs to start training:Training Types
Thetype parameter sets intelligent defaults optimized for your use case:
| Type | Best For |
|---|---|
Style | Artistic styles, visual aesthetics |
Character | Personal likeness, consistent characters |
Object | Specific items, products |
Default | Generic training |
Parameters
Required Parameters
A descriptive name for your custom style.Example:
"Ukiyo-E Style", "Product Photos"Array of image URLs to train on. Include more images for better results.
Optional Parameters
Base model for training:Image models:
flux_dev- High quality, versatileflux_schnell- BFL’s realtime modelqwen- Alibaba’s modelwan22- Image generation only
wan- Alibaba’s video model
Training category:
Style, Object, Character, or DefaultCustom word to activate this style in prompts. When not specified, uses the style name.
Advanced Parameters
Advanced Parameters
Tuning Advanced Parameters
Start with defaults set by thetype field—they work well for most cases. Only adjust these if you’re seeing specific issues:
Learning Rate
Learning Rate
Controls how aggressively the model adapts to your training images.
Signs you need to adjust:
| Value | When to Use |
|---|---|
| 0.0001 (lower) | Overfitting issues, complex styles, small datasets |
| 0.0003 (default) | Most use cases |
| 0.0005-0.001 (higher) | Faster training |
- Outputs look identical to training images → lower the rate
- Style influence is weak after training → raise the rate slightly
Training Steps
Training Steps
How long the model trains on your images.
Signs you need to adjust:
| Dataset Size | Recommended Steps |
|---|---|
| 5-10 images | 300-500 steps |
| 15-30 images | 500-800 steps |
| 50+ images | 800-1500 steps |
- Outputs are too rigid, ignoring prompts → reduce steps
- Style influence is weak → increase steps
- Generated images look exactly like training data → reduce steps (overfitting)
Response Format
Monitor Training Progress
Training typically takes 5-15 minutes. Poll the Jobs API to check status:Job Status Values
Job Status Values
Training jobs progress through these states:
- queued - Waiting in queue
- processing - Active training
- completed - Training finished successfully
- failed - Training encountered an error
- cancelled - Job manually cancelled
Use Your Trained Style
Once training completes, apply your style to image generation using thestyles parameter:
Style Strength
Thestrength parameter (0.0-1.0) controls how strongly your style is applied:
| Strength | Effect |
|---|---|
| 0.5-0.7 | Subtle influence, maintains prompt flexibility |
| 0.8-0.9 | Strong style application, recommended starting point |
| 0.95-1.0 | Maximum style adherence, may reduce prompt responsiveness |
Combining Multiple Styles
Apply multiple styles by adding them to thestyles array:
Best Practices
Image Selection
Image Selection
- Use as many high-quality images as you have for optimal results
- Ensure consistent style across all training images
- Include variety in subjects while maintaining style coherence
- Avoid watermarks, text overlays, or artifacts
- Use images at least 1024x1024 resolution
Training Configuration
Training Configuration
- Start with default parameters using the
typefield - For styles: 500-1000 steps is usually sufficient
- Lower learning rates (0.0001-0.0003) prevent overfitting
- Increase steps if style isn’t strong enough
- Decrease steps if output is too rigid
Trigger Words
Trigger Words
- Use the same trigger word if you plan on combining multiple styles
- Trigger words are automatically injected into the prompt if you include the style
- Avoid common words that appear in typical prompts
- Use underscores for multi-word triggers:
my_custom_style