Feature (UI): add model path update for external models#8675
Feature (UI): add model path update for external models#8675lstein merged 10 commits intoinvoke-ai:mainfrom
Conversation
Add ability to update file paths for externally managed models (models with absolute paths). Invoke-controlled models (with relative paths in the models directory) are excluded from this feature to prevent breaking internal model management. - Add ModelUpdatePathButton component with modal dialog - Only show button for external models (absolute path check) - Add translations for path update UI elements
lstein
left a comment
There was a problem hiding this comment.
Add support for Windows UNC paths that have format \\ServerName\
invokeai/frontend/web/src/features/modelManagerV2/subpanels/ModelPanel/ModelView.tsx
Outdated
Show resolved
Hide resolved
…ernalModel function now detects: Unix absolute paths: /home/user/models/... Windows drive paths: C:\Models\... or D:/Models/... Windows UNC paths: \\ServerName\ShareName\... or //ServerName/ShareName/...
|
The UNC path issue is fixed. However, I ran into a gotcha! I changed the path of an external model to an invalid path name: "fee fie foe fum" and saved it. Now the "Update Path" button is gone and I have no user-accessible way of changing the path name back. Should there be a check that the entered path points to a valid file, or at least that it has a format that matches the check for external paths? |
lstein
left a comment
There was a problem hiding this comment.
Address possibility that user will enter a path that does not match the external path detection rules.
… paths When updating an external model's path, the new path is now validated to ensure it follows an absolute path format (Unix, Windows drive, or UNC). This prevents users from accidentally entering invalid paths that would cause the Update Path button to disappear, leaving them unable to correct the mistake.
…uchensack/InvokeAI into feature/model-update-path
…endency Moves the isExternalModel utility function to its own file to break the circular dependency between ModelView.tsx and ModelUpdatePathButton.tsx.
|
It is no longer possible to set a path that is not recognized as a path |
lstein
left a comment
There was a problem hiding this comment.
Tested and is working as expected.

Summary
Adds ability to update the file path for external models in the Model Manager.
What:
D:/Models/model.safetensors)uuid/model.safetensors) are excludedWhy:
Users who manage their model files externally may move them to different locations on disk. This feature allows updating the path in InvokeAI's database without having to remove and re-add the model.
How:
isExternalModel()helper that checks if a path is absolute (Unix/...or WindowsX:/...)ModelUpdatePathButtoncomponent with modal for path inputuseUpdateModelMutationAPIRelated Issues / Discussions
QA Instructions
Negative test:
Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)