Support v-prediction checkpoint models when set in the model manager #7504
+10
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Capture prediction type from model settings and pass it to the scheduler to enable v_prediction checkpoints to work again.
Related Issues / Discussions
I'm certain there is a more correct way to handle this in the model manager that would also allow automatic detection from checkpoint files, but this at least gets vpred models working again before we go make sweeping changes to the model probe code.
Since our conversion code does not check the settings on the checkpoint, attempting to convert a v_prediction model to Diffusers will still default over to epsilon prediction and it will forever fail afterwards. It is not currently possible for users to change a diffusers model to v_prediction in Invoke without editing the local json files. User Mewt on discord has found that huggingface repos with correct scheduler_config.json are able to work without issues, but I have found others online that still specify epsilon.
Closes #7495
QA Instructions
Before:
After:
Checklist
What's New
copy (if doing a release after this PR)