LocalForge AILocalForge AI
LibraryBlogFAQ

How to Train an SD 1.5 LoRA

An SD 1.5 LoRA should be trained and tested as an SD 1.x adapter, not as a smaller version of an SDXL project. Stable Diffusion 1.5 uses the SD 1.x UNet, one CLIP text encoder, and a 512-class training regime. Those boundaries affect checkpoint selection, image bucketing, caption length, memory use, target modules, and the loader used at inference. An SDXL preset can complete a run while applying assumptions that do not belong in an SD 1.5 experiment.

This guide builds a repeatable local workflow around that architecture. You will lock the exact base checkpoint, clean and caption the dataset, choose conservative network settings, run a short smoke test, save intermediate checkpoints, and evaluate each candidate with fixed prompts and seeds. The goal is not one magic recipe. It is a controlled baseline that reveals whether a problem comes from data, captions, optimization, compatibility, or too much training. General Kohya setup belongs in the existing Kohya guide. SDXL and newer transformer families require their own architecture-specific instructions.

What Makes This an SD 1.5 Workflow

Stable Diffusion 1.5 belongs to the SD 1.x family. Its denoising model and text-conditioning path differ from SDXL, Flux, and other later families. A LoRA stores changes for selected modules in that model. The adapter must therefore be created for, and loaded into, a compatible SD 1.x checkpoint.

Use these boundaries from the start:

  • Select an SD 1.5 or compatible SD 1.x checkpoint as the training base.
  • Start with image buckets centered on the 512-class resolution used by SD 1.5.
  • Use the SD 1.5 training path in your trainer, not its SDXL mode.
  • Treat CLIP skip as a checkpoint-specific inference setting, not a universal training fix.
  • Test the adapter first on the exact checkpoint used for training.
  • Load it with an SD 1.x-aware LoRA loader.

SDXL uses a larger native image regime, a different UNet, and two text encoders. Flux uses a transformer-based denoiser and a different text stack. Their presets, target-module names, memory strategies, and prompt tests do not transfer automatically.

Define the Training Target

Write one sentence describing what the adapter should add and what it should leave controllable. Examples:

  • A person LoRA should preserve identity while allowing changes to clothing, setting, framing, and lighting.
  • An object LoRA should preserve defining geometry and markings across viewpoints and environments.
  • A style LoRA should transfer line, color, texture, and rendering treatment without forcing one subject.
  • A pose LoRA should reproduce body arrangement without copying the training identity or background.

This sentence guides image selection, captions, validation prompts, and the stopping decision. If the target is vague, a visually impressive sample can hide that the adapter learned the wrong correlation.

Record the license and provenance of the base model and dataset before training. Do not distribute an adapter unless the source terms and image rights permit the intended use.

Step 1: Lock the Exact SD 1.5 Base

Save the checkpoint filename, source URL, SHA-256 hash, and model family in the project record. If the model page identifies a required VAE or special prompting convention, record that too.

A heavily fine-tuned SD 1.5 checkpoint can be the right base when the LoRA is intended only for that ecosystem. A cleaner base may offer broader portability across SD 1.5 derivatives, but portability is not guaranteed. Train against the checkpoint that matches the actual product goal, then describe compatibility conservatively.

Do not select a model because its filename contains v1. Verify the source record and, when available, embedded metadata. An SDXL or other-family checkpoint cannot become an SD 1.5 base through renaming or conversion of the file extension.

Step 2: Build a Dataset That Shows the Concept

Remove corrupted files, near-duplicates, watermarks you do not want learned, and images where the target is too small or obscured. Inspect the set as a contact sheet rather than one image at a time.

Check coverage across:

  • close, medium, and wider framing where relevant;
  • useful angles and viewpoints;
  • lighting and background variation;
  • poses or object arrangements;
  • changeable clothing, accessories, and colors;
  • both common and defining details of the concept.

SD 1.5 has less spatial capacity than newer, larger architectures. Very small details may not survive preprocessing or become independently controllable. Crop to make the subject legible, but do not turn every image into the same centered composition. Consistent framing can bind the crop to the trigger.

More files do not guarantee a better adapter. Repeated versions of one source image increase exposure without adding meaningful evidence. A compact, varied set is easier to audit than a large scrape with uncertain labels.

Step 3: Prepare SD 1.5 Image Buckets

Begin with a 512-class target appropriate to SD 1.5, while preserving aspect ratios through bucketing when the trainer supports it. Buckets group images into nearby dimensions so the pipeline does not force every source into one square crop.

Review the bucket report. Extremely narrow or tall sources may be cropped heavily, placed into inefficient buckets, or contribute weak subject detail. Fix the source composition instead of assuming bucket automation makes every image useful.

Do not copy a 1024 SDXL preset into this run. Upscaling every source to 1024 does not give the SD 1.5 base SDXL capacity, and it increases memory and training cost. A deliberate higher-resolution SD 1.5 experiment is possible in some tools, but it should come after a working 512-class baseline and should be evaluated as a separate run.

Step 4: Caption for Separation and Control

Use one stable trigger when the concept needs a unique invocation token. Keep spelling and capitalization consistent. Describe attributes that vary and should remain controllable, such as clothing, pose, setting, crop, color, or subject content.

For a person concept, a caption might identify the trigger and class, then describe the current outfit, pose, and setting. For a style concept, identify the pictured subject and scene so those contents are less likely to bind to the style trigger.

Verify that the trainer actually reads each sidecar or metadata row. Filename stems, extensions, folder scope, caption columns, and text caches must match the launched configuration. Inspect processed-caption previews when available.

SD 1.5 normally uses the CLIP text-conditioning path associated with its model family. Long tag dumps can push useful terms beyond the effective token window. Put the trigger and important class language early, remove false tags, and avoid treating dozens of generic quality words as useful supervision.

Shuffle only separable tag items. Do not scramble natural-language sentences. If trigger position matters, use the trainer's documented keep-token behavior and confirm the processed result.

Step 5: Choose a Conservative Network Baseline

Start with a standard LoRA network supported by the SD 1.5 path. Network rank controls adapter capacity, while alpha participates in scaling. Higher rank increases file size and can make a small dataset easier to memorize. It is not a direct quality control.

Choose a conservative preset whose model type explicitly says SD 1.5 or SD 1.x. Record:

  • network module, rank, and alpha;
  • trained components, such as UNet only or UNet plus text encoder;
  • optimizer and its arguments;
  • UNet and text-encoder learning rates;
  • scheduler, warmup, and total optimizer steps;
  • batch size and gradient accumulation;
  • precision and memory options;
  • repeats, epochs, save interval, and random seed.

UNet-only training is a clean first baseline. Text-encoder training can strengthen trigger association, but it also adds another learning path and can reduce prompt flexibility if pushed too hard. Add it only as a measured experiment, with a separately recorded learning rate and checkpoint comparison.

Optimizer choice and learning rate must be considered together. Do not copy a rate from a different optimizer, architecture, or batch regime. Verify the effective rate and global step in the log rather than trusting that a GUI field reached the training script unchanged.

Step 6: Calculate Exposure

Image count, repeats, epochs, batch size, accumulation, and process count determine how many optimizer updates occur. Write down the trainer's estimated steps before launch.

Repeats can balance subsets, but they also amplify duplicate and mislabeled examples. Epochs are useful only when their meaning stays tied to a fixed dataset configuration. Compare experiments by actual optimizer steps and dataset composition, not by epoch number alone.

Avoid universal claims such as a fixed number of steps per image. Identity, style, pose, and object concepts differ in difficulty. Dataset variety, caption design, trained modules, learning rate, and rank change how much useful learning occurs per update.

Step 7: Create Validation Prompts

Prepare the test suite before training so it cannot be rewritten to flatter a disappointing result. Include:

  1. a direct trigger prompt that makes the target easy to recognize;
  2. a variation prompt with a new background, outfit, subject, or lighting setup;
  3. a framing or viewpoint test absent from the most common training composition;
  4. a prompt-adherence test with a clear changeable attribute;
  5. a no-trigger control that checks whether the adapter changes unrelated output.

Use fixed seeds and preserve the sampler, scheduler, step count, guidance, dimensions, negative prompt, VAE, and base checkpoint. Generate samples at intermediate save points when the trainer supports it.

A single sample can be lucky. Several fixed seeds reveal whether the concept is reliable or appears only under favorable noise.

Step 8: Run a Short Smoke Test

Before the full run, train long enough to confirm the complete path:

  • the checkpoint is recognized as SD 1.5;
  • expected images and captions are loaded;
  • buckets look reasonable;
  • caches are created or reused intentionally;
  • loss remains finite;
  • samples generate;
  • a saved adapter loads in the target inference interface.

Read startup warnings. Missing and unexpected keys, zero-caption counts, skipped files, and fallback text are evidence. Stop and fix them. A completed .safetensors file does not prove that the intended modules or text were used.

If memory fails, lower batch size first and use memory features documented for the exact SD 1.5 training path. Change one pressure point at a time so the working configuration remains understandable.

Step 9: Train and Compare Checkpoints

Save several checkpoints. Test each on the original training base with no other LoRAs, embeddings, ControlNet units, face restorers, or hidden prompt presets.

Generate an adapter-off baseline, then test a modest range of supported LoRA weights. Weight scales are not perfectly standardized across every loader and network type, so look for a useful range rather than demanding one universal value.

Judge four outcomes:

  • Fidelity: Does the intended identity, object, style, or pose appear?
  • Control: Can the prompt change attributes that should remain variable?
  • Range: Does the concept work across seeds, framing, and new contexts?
  • Damage: Do anatomy, texture, contrast, color, or unrelated subjects degrade?

The last checkpoint is not automatically the best. Choose the earliest checkpoint that reaches reliable fidelity without losing control. If later saves repeat backgrounds, poses, faces, or colors, select an earlier checkpoint and reduce exposure in the next run.

Diagnose a Weak SD 1.5 Result

If the adapter has no visible effect, verify the active loader, exact trigger, model family, checkpoint, and adapter weight before retraining. An SDXL adapter in an SD 1.5 workflow is a compatibility failure, not undertraining.

If later checkpoints improve steadily but remain weak at moderate weights, the run may need additional exposure or a measured learning-rate change. If all checkpoints are equally weak, audit captions, target modules, data visibility, and optimizer initialization. If output becomes rigid or damaged as training continues, more steps will make the wrong pattern stronger.

Use the dedicated underfitting guide for the full learning-pressure diagnosis. This page keeps the focus on constructing and validating the SD 1.5 run.

How This Differs From SDXL and General Kohya Guides

The SDXL guide should cover its 1024-class image regime, SDXL UNet, dual text encoders, and SDXL-specific memory and training choices. Those are not optional extras for SD 1.5.

The general Kohya guide covers installation, interface navigation, configuration reuse, and trainer-wide workflow. This guide assumes you already have a supported trainer and narrows the decisions to SD 1.5 architecture, 512-class preprocessing, its text encoder, and SD 1.x inference compatibility.

Do not blend all three pages into one preset. Use the Kohya guide for the tool, this guide for the SD 1.5 experiment, and the SDXL guide only when the base is actually SDXL.

Final Checklist

Before accepting the adapter:

  1. The training base is verified as SD 1.5 or compatible SD 1.x.
  2. The model source, hash, license, and dataset provenance are recorded.
  3. Images show useful variation and no accidental duplicate weighting.
  4. Buckets preserve composition near an SD 1.5-appropriate target.
  5. Captions and trigger text load exactly as intended.
  6. Network, optimizer, learning rates, steps, and trained modules are saved.
  7. The smoke-test adapter loads in an SD 1.x-aware inference path.
  8. Intermediate checkpoints are compared with fixed prompts and seeds.
  9. The selected checkpoint works at a usable weight without locking the prompt.
  10. Compatibility claims are limited to checkpoints you actually tested.

LoRA Studio can organize the project record and evaluation flow, while sd-scripts, Kohya interfaces, and Diffusers provide transparent architecture-specific training and loading paths.

Bottom Line

A reliable SD 1.5 LoRA starts with a verified SD 1.x base, 512-class dataset preparation, captions that separate the target from changeable attributes, and conservative settings recorded as one reproducible experiment.

Save checkpoints, test them on the original base, and stop on visual evidence. Keep SDXL presets and Flux assumptions out of the run. Architecture matching is the first requirement, and controlled checkpoint comparison is the final proof.

What to Do Next

FAQ

Can I train an SD 1.5 LoRA with SDXL settings? +
No reliable preset transfers as-is. SD 1.5 and SDXL use different UNets, text-encoder arrangements, resolution regimes, target modules, and loaders. Select the trainer's explicit SD 1.5 path.
What resolution should I use for SD 1.5 LoRA training? +
Start with a 512-class target and aspect-ratio buckets appropriate to SD 1.5. Treat higher-resolution training as a separate experiment after a controlled baseline works.
Should an SD 1.5 LoRA train the text encoder? +
Not automatically. UNet-only training is a clean baseline. Text-encoder training can strengthen token association but adds overfitting and prompt-control risks, so test it separately.
Can an SD 1.5 LoRA work on SDXL? +
No. The architectures have different model components, so their LoRA weights are not interchangeable even when both files use the safetensors format.
How many steps does an SD 1.5 LoRA need? +
There is no universal count. Dataset size, repeats, batch settings, rank, learning rate, captions, and concept difficulty all change useful exposure. Compare saved checkpoints.
Why is my SD 1.5 LoRA weak? +
First verify loading, trigger spelling, inference weight, and SD 1.x compatibility. Then compare checkpoints to determine whether learning is improving, flat, or already degrading.