Fix AI features ignoring plugins/ai/models_path override#21078
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #21049, which added the
plugins/ai/models_pathconf key to let users point darktable at a custom AI models folder. The preferences page picked the override up correctly (the AI tab listed installed models), but neural restore and the AI object mask tool kept reporting "model not found" – both created their owndt_ai_environment_tviadt_ai_env_init(NULL), which scanned only the XDG default and didn't know about the conf key.This was the case @wpferguson's multi-instance setup needed in the first place, so it should actually work end-to-end.
What this PR does
Has
dt_ai_env_init(NULL)fall back to the sameplugins/ai/models_pathvalue the registry already honors. The resolution lives in one helper,dt_ai_resolve_models_path_override(), so the registry, neural restore's env, and the object mask's env all read the path from the same source going forward.