Skip to content

Phase 1 - Input validation - #1296

Merged
dxqb merged 18 commits into
Nerogar:masterfrom
O-J1:input-validation
Feb 22, 2026
Merged

Phase 1 - Input validation#1296
dxqb merged 18 commits into
Nerogar:masterfrom
O-J1:input-validation

Conversation

@O-J1

@O-J1 O-J1 commented Feb 7, 2026

Copy link
Copy Markdown
Collaborator

Since we no longer need auto-reversion, to ease review and deal with the seemingly corrupted git branch I have rewritten #908 as seperate PR's.

This PR does the following:

  • input validation for entry/path_entry components,
  • prevents training from starting if there are invalid values, popping up a messagebox warning of the reason.
  • Borders turn red on invalid input after a debounce of 250ms.
  • Undo and redo to all entry/path_entry (ctrl + z and shift+ctrl+z/ctrl+y)
  • required params and extra_validation functionality to enable input specific (and not reusable) validation.
  • deletes dead lora tab code from TrainUI.py (superseded by LoraTab.py a year ago)

Importantly tooltips, auto-correction and friendly names and such have been intentionally excluded to keep files changed more managable 🙂

Tested on Linux and Windows.

@O-J1
O-J1 marked this pull request as ready for review February 8, 2026 06:43
@dxqb

dxqb commented Feb 12, 2026

Copy link
Copy Markdown
Collaborator

thanks!

Comments from testing, no code review yet:

  • validation doesn't have a warning Level anymore, even overwriting is red and an error. If this is introduced in Phase 2, note to self: Do not merge this on its own. Intentional, driven by prevent overwrite toggle
image
  • I think the comment from the previous PR still partially applies - even if there is currently no autocorrect etc - why all the path validation code for a single entry component that saves a file?

  • Most of our path entries are read from - but those are currently not validated. I think they were in the previous PR. Example:

image

@O-J1

O-J1 commented Feb 12, 2026

Copy link
Copy Markdown
Collaborator Author

validation doesn't have a warning Level anymore, even overwriting is red and an error. If this is introduced in Phase 2, note to self: Do not merge this on its own.

Intentional, its only an error if the user has the "Prevent Overwrites" toggle set to true.

even if there is currently no autocorrect - why all the path validation code for a single entry component that saves a file

This is the input validation component and we've established that:

  1. this has tripped up countless people and is a support burden
  2. unless Model Output Destination is split to destination folder and an actual run name field (Which Nero has not allowed) then it will always continue to be an issue.

Thus why I felt the need to add validation based on real world support examples. Its the top 3 issues we see after no git and wrong python

Most of our path entries are read from - but those are currently not validated. I think they were in the previous PR.

I can add that back in, sure Done ✅

@O-J1

O-J1 commented Feb 16, 2026

Copy link
Copy Markdown
Collaborator Author

Calamador has started testing. Heres what he found:

  • The Training Resolution field is a funky edge case. It takes in an INT or a string that we coerce to a tuple/two variables (have to check code). Right now invalid resolutions with something like 1024a are accepted. Maybe need to introduce field specific just for this field?

@hameerabbasi hameerabbasi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider the line breaks optional. Most stuff is code quality only, not behavior changes.

Comment thread modules/ui/ModelTab.py Outdated
Comment thread modules/ui/TrainingTab.py Outdated
Comment thread modules/ui/TrainingTab.py Outdated
Comment thread modules/ui/TrainingTab.py Outdated
Comment thread modules/ui/TrainingTab.py Outdated
Comment thread modules/ui/TrainingTab.py Outdated
Comment thread modules/ui/TrainingTab.py Outdated
Comment thread modules/ui/TrainUI.py Outdated
Comment thread modules/util/ui/validation.py

@dxqb dxqb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • cloud pathes are currently rejected, for example as base model, or in concept paths:
    cloud:/workspace/my_model.safetensors

Comment thread modules/ui/TrainUI.py
Comment thread modules/ui/TrainUI.py
Comment thread modules/util/config/TrainConfig.py Outdated
Comment thread modules/util/ui/validation.py Outdated
Comment thread modules/util/ui/validation.py
Comment thread modules/util/ui/validation_helpers.py Outdated
@O-J1

O-J1 commented Feb 21, 2026

Copy link
Copy Markdown
Collaborator Author

All raised issues including prevent overwrites being true by default, have been addressed. Ready for merge by itself into main.

Do not merge it into phase 2, nor merge phase 2 into it.

@dxqb
dxqb merged commit bfc14ef into Nerogar:master Feb 22, 2026
1 check passed
@O-J1
O-J1 deleted the input-validation branch March 6, 2026 08:09
BitcrushedHeart pushed a commit to BitcrushedHeart/OneTrainer that referenced this pull request Jun 20, 2026
---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants