Skip to content

Minimal configs, enable easy CLI, ground work for test suite#1531

Open
dxqb wants to merge 1 commit into
Nerogar:masterfrom
dxqb:multi-config-train-test
Open

Minimal configs, enable easy CLI, ground work for test suite#1531
dxqb wants to merge 1 commit into
Nerogar:masterfrom
dxqb:multi-config-train-test

Conversation

@dxqb

@dxqb dxqb commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR makes it easy to run multiple presets using a minimal config. It does that by adding two things to train.py:

  • --preset-path: applies a built-in preset file before the main --config-path config (without migration, since built-in presets are always saved in the current format).
  • --config-value KEY=VALUE: applies a final override after both, with dotted-path support for nested config objects (e.g. ema.decay=0.99). Repeatable.

Example:
./run-cmd.sh train --preset-path "training_presets/#flux2 LoRA 16GB.json" --config-path "test/minimal.json" --config-value output_model_destination=models/my_lora.safetensors

The minimal.json (added in #1545) is, as the name suggests, minimal:

{
    "epochs": 2,
    "batch_size": 2,
    "tensorboard": false,
    "concepts": [
        {
            "path": "resources/icons",
            "text": {
                "prompt_source": "concept",
                "prompt_path": "resources/test/logo.txt"
            }
        }
    ],
    "samples": [
        {
            "prompt": "a mouse eating the OneTrainer logo",
            "width": 512,
            "height": 512,
            "cfg_scale": 3.0,
            "diffusion_steps": 20
        }
    ]
}

The idea is to layer config values on top of each other:

  1. defaults as defined in TrainConfig
  2. values taken from the preset file
  3. values taken from the config file
  4. any --config-value overrides

By doing that, your config can be very simple and isn't model-specific anymore.

This isn't a test suite, but it enables one by making it easier to run CLI trainings, @O-J1 @hameerabbasi — see #1545 for the smoke-test scripts built on top of this.

AI assistance

  • AI-assisted — I have read every line in this diff and can defend each change

@dxqb

This comment was marked as resolved.

@dxqb

This comment was marked as resolved.

dxqb added a commit that referenced this pull request Jun 19, 2026
@dxqb dxqb force-pushed the multi-config-train-test branch 2 times, most recently from b3965d5 to 7be1a67 Compare June 20, 2026 09:08
@dxqb dxqb marked this pull request as ready for review June 20, 2026 09:26
--preset-path lets a built-in preset be applied (without migration, since
built-in presets are always saved in the current format) before the main
config file. --config-value KEY=VALUE applies a final override after both,
with dotted-path support for nested config objects - useful for scripting
training runs without hand-editing a config file (e.g. overriding the output
path or disabling compile per-run).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview merged in the preview branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant