Skip to main content

Overview

Fine-tune image generation models to create images in your specific style, brand, or artistic direction. Perfect for branded content, character design, or artistic styles.

Your Data

Your training data should have:
  • Image column - Paths or URLs to your training images
  • Caption column - Text descriptions of each image
Example data in images.parquet:
imagecaption
images/001.jpga red sports car in cyberpunk style
images/002.jpga blue sedan in cyberpunk style
images/003.jpga motorcycle in cyberpunk style

Minimal Example

import requests

url = "https://hub.oxen.ai/api/repos/YOUR_NAMESPACE/YOUR_REPO/fine_tunes"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

# Create fine-tune
data = {
    "resource": "main/images.parquet",
    "base_model": "black-forest-labs/FLUX.1-dev",
    "script_type": "image_generation",
    "training_params": {
        "image_column": "image",         # Your image column name
        "caption_column": "caption",     # Your caption column name
        "steps": 2000
    }
}

response = requests.post(url, headers=headers, json=data)
fine_tune_id = response.json()["fine_tune"]["id"]

# Start training
run_url = f"{url}/{fine_tune_id}/actions/run"
requests.post(run_url, headers=headers)

print(f"Fine-tune started: {fine_tune_id}")

Key Parameters

Only these fields are required to start:
ParameterDescriptionExample
image_columnName of your image column"image", "file", "path"
caption_columnName of your caption/prompt column"caption", "prompt", "description"
stepsNumber of training steps (1000-3000 typical)2000
All other parameters use sensible defaults.

Supported Models

Popular choices for image generation:
  • black-forest-labs/FLUX.1-dev - High quality, state-of-the-art
  • black-forest-labs/FLUX.2-dev - Latest version, even better quality
  • Qwen/Qwen-Image - Fast, good for quick iterations
See the full model list for all available options.

Data Requirements

For best results:
  • Quantity: 10-50 images minimum, 100-500 images ideal
  • Quality: High resolution, consistent style
  • Captions: Descriptive prompts that explain what makes your images unique
  • Consistency: Images should share common elements (style, subject, theme)

Monitor Progress

Image models generate sample outputs during training. Check them to see progress:
status_url = f"https://hub.oxen.ai/api/repos/YOUR_NAMESPACE/YOUR_REPO/fine_tunes/{fine_tune_id}"
response = requests.get(status_url, headers=headers)
fine_tune = response.json()["fine_tune"]

print(f"Status: {fine_tune['status']}")
print(f"Current step: {fine_tune.get('current_step', 0)}")

# Sample images are generated every 200 steps by default
if "sample_outputs" in fine_tune:
    print(f"Sample images: {fine_tune['sample_outputs']}")

Next Steps

Common Issues

Ensure image paths are relative to your repository root, or use full URLs. Check that images are committed to your Oxen repository.
Reduce batch_size to 1. Image models require significant GPU memory.
Try training for more steps (3000-5000) or increase your dataset size. Ensure captions clearly describe the unique aspects of your style.
Start with 1000 steps for testing. FLUX models take 1-2 hours on GPU for 2000 steps.