Skip to main content

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 configuration

Monitor Progress

Track your training job status using the returned job_id

Generate 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:

How Many Images?

Quality matters far more than quantity. A small set of excellent images will outperform a large set of mediocre ones.
Quality > Quantity15 high-quality images will produce better results than 50 low-quality ones. Prioritize:
  • High resolution (1024x1024 minimum)
  • Consistent style across all images
  • No watermarks, text overlays, or compression artifacts
  • Varied subjects while maintaining style coherence
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:
Save the returned image_url values—you’ll pass these to the training endpoint.

Train Your Style

Basic Training Example

Submit your image URLs to start training:

Training Types

The type parameter sets intelligent defaults optimized for your use case:

Parameters

Required Parameters

name
string
required
A descriptive name for your custom style.Example: "Ukiyo-E Style", "Product Photos"
urls
array
required
Array of image URLs to train on. Include more images for better results.

Optional Parameters

model
string
default:"flux_dev"
Base model for training:Image models:
  • flux_dev - High quality, versatile
  • flux_schnell - BFL’s realtime model
  • qwen - Alibaba’s model
  • z-image - Alibaba’s efficient image model
  • wan22 - Image generation only
Video models:
  • wan - Alibaba’s video model
type
string
default:"Default"
Training category: Style, Object, Character, or Default
trigger_word
string
Custom word to activate this style in prompts. When not specified, uses the style name.
Choose unique trigger words that won’t appear in typical prompts. Use underscores for multi-word triggers: ukiyo_style
learning_rate
number
Controls training intensity. Higher values train faster but may overfit.Recommended range: 0.0001 - 0.001
max_train_steps
integer
Maximum training iterations. Range: 1-2000
batch_size
integer
Images processed simultaneously. Larger batches = faster training but more memory.

Tuning Advanced Parameters

Start with defaults set by the type field—they work well for most cases. Only adjust these if you’re seeing specific issues:
Controls how aggressively the model adapts to your training images.Signs you need to adjust:
  • Outputs look identical to training images → lower the rate
  • Style influence is weak after training → raise the rate slightly
How long the model trains on your images.Signs you need to adjust:
  • Outputs are too rigid, ignoring prompts → reduce steps
  • Style influence is weak → increase steps
  • Generated images look exactly like training data → reduce steps (overfitting)
Iterative TuningIf your first training attempt doesn’t produce the results you want:
  1. Start by adjusting max_train_steps (most common fix)
  2. Then try learning_rate if steps alone don’t help

Response Format


Monitor Training Progress

Training typically takes 5-15 minutes. Poll the Jobs API to check status:
Training jobs progress through these states:
  1. queued - Waiting in queue
  2. processing - Active training
  3. completed - Training finished successfully
  4. failed - Training encountered an error
  5. cancelled - Job manually cancelled

Use Your Trained Style

Once training completes, apply your style to image generation using the styles parameter:
Style ownership between the app and APIThe API and the Krea web app operate as separate user identities within your workspace. Styles are private to the user who created them, so:
  • App-trained styles are not accessible via the API unless shared
  • API-trained styles are not accessible in the app unless shared
To share a style with your workspace (works in both directions):

Style Strength

The strength parameter (0.0-1.0) controls how strongly your style is applied:
Start with 0.8 strength and adjust based on results. Lower values give more creative freedom; higher values enforce stricter style adherence.

Combining Multiple Styles

Apply multiple styles by adding them to the styles array:

Best Practices

  • 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
  • Start with default parameters using the type field
  • 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
  • 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