LocalForge AILocalForge AI
LibraryBlogFAQ

How to Prepare Images for LoRA Training

Image preparation isn't a batch resize job. Your goal is to preserve the visual evidence the LoRA needs while removing defects, duplicates, and accidental patterns it should never learn. Stretching every file into a square, applying heavy face restoration, or upscaling tiny sources can make a dataset look tidy while making the training signal worse.

This guide gives you a repeatable image-only workflow before captioning and training. You'll define the concept, curate candidates, check rights, remove duplicates, correct orientation, choose crops, handle mixed aspect ratios, make conservative edits, standardize filenames, and run a final contact-sheet review. The process works with common local trainers, including tools that support aspect-ratio bucketing and per-image caption sidecars. You’ll know exactly what belongs in the final export folder.

Quick Answer

Keep sharp, accurate images that show the same concept across useful angles, crops, lighting, and contexts. Remove duplicates, text overlays, borders, severe artifacts, and images where the concept is too small or obstructed.

Don't stretch images to a fixed square. Preserve aspect ratio and use buckets when available. Crop only when it improves concept visibility, and avoid heavy restoration or upscaling that invents detail. Keep untouched originals in a separate folder and train from a clean export folder.

Before You Edit: Define the Visual Target

Write down what must remain consistent and what should vary. For a person, identity should remain while pose, clothing, lighting, and setting change. For a product, shape and markings remain while viewpoint and background change. For a style, rendering language remains while subjects and compositions change.

This prevents destructive cleanup. If freckles matter to identity, smoothing them away is damage. If a recurring watermark doesn't matter, leaving it in is damage.

Step 1: Make a Safe Working Copy

Keep three folders:

  1. Originals: Untouched sources with their original resolution and metadata.
  2. Candidates: Files under review and editing.
  3. Training export: Only approved images in the format your trainer will read.

Never overwrite the only copy. You may discover after a test run that an aggressive crop removed useful context or that a color correction changed identity details.

Step 2: Confirm Rights and Consent

Use images you own or have permission and sufficient rights to train on. For real people, get consent appropriate to your use. Public availability isn't the same as permission.

Remove private metadata from shared datasets when needed, but don't treat metadata stripping as a substitute for lawful collection. Keep your own provenance notes outside the training folder.

Step 3: Reject Weak Sources First

Don't spend time repairing files that shouldn't be included.

Reject images with:

  • Severe blur: Important identity or object details aren't readable.
  • Heavy compression: Blocks, ringing, or smeared texture cover the concept.
  • Obstruction: Hands, props, hair, or other subjects hide critical features.
  • Overlays: Watermarks, captions, logos, timestamps, frames, or UI elements aren't part of the target.
  • Wrong details: Generated anatomy, geometry, text, or identity is incorrect.
  • Tiny concept area: Most pixels describe the background instead of the concept.

One technically imperfect image may still add a rare angle. Keep it only if its unique evidence outweighs the defect.

Step 4: Remove Exact and Near-Duplicates

Exact duplicate detection is easy, but visual duplicates matter more. Burst photos, consecutive video frames, and generated variations can overweight a single pose.

Compare candidates in a contact sheet. For each near-duplicate group, keep the sharpest image with the cleanest anatomy and most accurate concept details. Retain a second only when framing, expression, angle, or visible features materially change.

Don't use mirrored copies as new data. A mirror can also reverse text, asymmetrical clothing, scars, product controls, or a character's defining side.

Step 5: Fix Orientation and Color Conservatively

Apply EXIF orientation so every image displays correctly after metadata is removed. A sideways source can be auto-rotated in one viewer and read incorrectly by another pipeline.

Correct clear exposure or white-balance errors only when they hide real detail. Avoid forcing all files into one color grade unless that grade is the style concept.

Use a consistent standard color workflow for exports. Exotic profiles and HDR sources can render unpredictably after conversion. Inspect converted files rather than assuming the batch result is correct.

Step 6: Crop for Information

Crop to remove irrelevant borders, excess empty space, or intruding subjects. Keep enough context for the trainer to understand structure.

For people and characters:

  • preserve the full head in some images;
  • include close, medium, and full-body views;
  • avoid cutting exactly at joints in every frame;
  • keep distinctive hair, accessories, or silhouette details visible.

For products and objects:

  • retain complete silhouettes in several files;
  • add detail crops separately rather than replacing all complete views;
  • don't crop out handles, ports, labels, or rear features that define the product.

A dataset of tight face crops may produce strong close-ups and weak bodies. Crop diversity matters as much as angle diversity.

Step 7: Preserve Aspect Ratio

Never stretch a portrait or horizontal image into a square. Stretching teaches distorted anatomy and proportions.

Use aspect-ratio bucketing if your trainer supports it. OneTrainer describes bucketing as grouping mixed aspect ratios while resizing images toward a similar pixel count. sd-scripts also exposes bucket settings through its dataset configuration.

If your workflow doesn't support buckets, crop deliberately to its expected dimensions. Preview every crop. Automatic center cropping can remove heads, shoes, tall products, or off-center subjects.

Step 8: Match the Base Model's Training Scale

Choose the trainer's resolution or bucket targets for the base model you're adapting. Don't copy a resolution from an unrelated tutorial.

Larger files don't automatically create more learned detail. The trainer preprocesses images to its configured size. Sources should contain real, readable detail at that scale, but exporting enormous files wastes storage and preprocessing time.

Avoid enlarging tiny sources just to meet dimensions. Upscaling estimates missing pixels; it doesn't recover identity detail that was never captured. If a small image is uniquely valuable, test it separately and inspect its effect.

Step 9: Use Restoration Sparingly

Face restorers, denoisers, sharpeners, and generative upscalers can change the very concept you're teaching.

Common problems include:

  • altered eye shape or skin texture;
  • invented eyelashes, jewelry, fabric, or hair;
  • plastic surfaces from denoising;
  • halos from sharpening;
  • inconsistent facial identity across restored images.

Prefer the clean original. If restoration is necessary, compare before and after at full size and reject any edit that changes identity or design.

Step 10: Decide on Augmentation Carefully

Augmentation can add variation, but only when the transformation preserves meaning.

  • Horizontal flips: Fine for symmetric concepts; wrong for text, logos, handed objects, scars, asymmetrical characters, and product controls.
  • Random crops: Useful when every possible crop keeps the concept readable; dangerous for small or edge-positioned subjects.
  • Color changes: Wrong when color defines the garment, product, or style.
  • Rotation: Small changes may help some objects, but arbitrary rotation can teach impossible orientation.

OneTrainer places augmentations in concept settings, while sd-scripts exposes options such as flip_aug, random_crop, and color augmentation. Enable them because they fit your concept, not because a preset includes them.

Step 11: Standardize Export Files

Use simple, unique names:

concept_001.png

concept_002.jpg

Avoid names that differ only by capitalization. Keep one image per stem so caption pairing remains obvious later.

JPEG is acceptable for photographic sources when saved at good quality. PNG is useful for lossless graphics or sources that already need it. Re-encoding a damaged JPEG as PNG doesn't restore quality.

Keep masks, captions, and metadata files out until your trainer's folder format is decided. OneTrainer, sd-scripts, and Diffusers don't use identical dataset conventions.

Step 12: Review the Final Contact Sheet

Create a grid of the training export and ask:

  • Is one outfit, room, palette, or camera angle dominating?
  • Are close-ups balanced with medium and wide views?
  • Does the concept look consistent in every file?
  • Are there repeated generated defects?
  • Did any crop remove a critical feature?
  • Does any image contain text or a border you missed?

Then open a sample from every source format at 100% zoom. Contact sheets reveal balance; full-size inspection reveals texture and compression.

Pre-Training Image Checklist

  • Originals are preserved separately.
  • Rights and consent are documented.
  • Exact and visual duplicates are removed.
  • Orientation is baked in correctly.
  • No image is stretched.
  • Crops preserve important features.
  • Tiny sources weren't blindly upscaled.
  • Restoration didn't change identity or design.
  • Augmentations fit the concept.
  • Filenames are unique and sidecar-friendly.

Once this folder passes review, LoRA Studio from LocalForge AI can take you through a guided local setup, while OneTrainer, sd-scripts, and Diffusers give you lower-level control over bucketing and preprocessing.

Bottom Line

Good preparation removes noise without manufacturing a cleaner-looking fiction. Preserve real detail, preserve proportions, and make every image earn its place.

The best export folder is boring: clean filenames, accurate files, useful variation, no mystery edits, and no surprises when the trainer reads it.

What to Do Next

FAQ

Should I resize all LoRA training images to the same size? +
Not necessarily. Preserve aspect ratio and use aspect-ratio bucketing when supported. If fixed dimensions are required, crop deliberately and preview every result instead of stretching.
Should I upscale low-resolution LoRA images? +
Only cautiously. Upscaling cannot recover missing source detail and generative upscalers may change identity or design. Prefer a genuinely sharper source.
Can I use both portrait and horizontal images? +
Yes. Mixed orientations are useful when they add composition coverage. Use a trainer with aspect-ratio buckets or prepare compatible crops without distortion.
Should I remove image backgrounds before LoRA training? +
Usually no. Varied real backgrounds help prevent one setting from binding to the concept. Remove a background only when your specific masked or isolated-object workflow calls for it.
Is horizontal flip augmentation safe? +
Only for concepts where left-right reversal preserves meaning. Avoid it for readable text, logos, scars, asymmetrical clothing, character details, and products with side-specific controls.