Skip to content

Install AI models from additional repositories - #21827

Open
andriiryzhkov wants to merge 2 commits into
darktable-org:masterfrom
andriiryzhkov:ai_model_repositories
Open

Install AI models from additional repositories#21827
andriiryzhkov wants to merge 2 commits into
darktable-org:masterfrom
andriiryzhkov:ai_model_repositories

Conversation

@andriiryzhkov

Copy link
Copy Markdown
Collaborator

Adds "install from repository…" to AI preferences: pick a repository, tick the models you want from its published listing, install. Models installed this way remember where they came from and are included in the update check. Repositories beyond the official one can be added and removed from the dialog.

Models outside darktable's bundled catalog were already installable – "import from file…" takes any .dtmodel. But getting one there is a manual round trip: find the repository, open the right release, work out which asset you need, download it, then import it. And that is where it ends. darktable has no idea where the file came from, so it can never tell you a newer version has been published; you only find out by going back and checking by hand.

A repository already publishes a versions.json listing everything in its release, which is all darktable needs to do both jobs itself.

pref1

What's in it

A combo at the top of the dialog picks the repository, so two repositories publishing the same model id stay separate instead of merging into one ambiguous list.

pref2

"manage repositories…" on the action row edits the list, and adding one verifies it first by fetching its listing – the same call the combo makes, so "it verified" and "it will work" mean the same thing. That is also the right moment to say the repository isn't reviewed by the darktable project and that installing a model from it replaces any installed model of the same name.

pref3

Each install records where it came from, so the models table can name a publisher. That column stays hidden until something is actually installed from outside the official repository – which is why it isn't in the first screenshot – so nothing changes for people who never touch this.

Update checks now cover every configured repository instead of only the official one, with each versions.json applying only to its own models – an id another repository happens to reuse is a different model, and giving it the wrong digest would break its next download.

The download cache is keyed on the asset digest rather than <id>.dtmodel, which two repositories and two releases both claim, so an interrupted transfer is never resumed into an unrelated one.

New config

plugins/ai/third_party_repositories – comma-separated owner/repo list, empty by default. Everything above is inert until someone adds one.

plugins/ai/repository keeps the meaning it shipped with in 5.6.0: the repository models come from. A mirror set there is still official as far as this installation is concerned.

Notes

Third-party repositories are now contacted during the update check, which is mentioned in the config description. Nothing is contacted unless the user has added one.

Installing a model that shadows an installed one asks first. Removing a repository doesn't touch models already installed from it.

@andriiryzhkov andriiryzhkov added the scope: AI features AI features related issues and PR label Aug 13, 2026
@TurboGit

Copy link
Copy Markdown
Member

I'm a bit balanced about this. It is indeed already possible to download a .dtmodel directly but at least this is not officially supported and so at the risk of the user. Adding this support directly into Darktable means we are supporting having other models not under the darktable.org umbrella. Also, is that a feature that is really asked? Or do you have yourself the need for this? Let's discuss your view on this and the ultimate goal, I'm open, just not fully convinced that it is a good move at the moment.

@andriiryzhkov

Copy link
Copy Markdown
Collaborator Author

There was one request to simplify installation of uncatalogued (non listed on the pref page) models. We currently have some optional models available in the repository.

Another use case, I personally interested in - using AI models that does not meet darktable requirements and can not be added to the official repository. So I would have personal repository, which I'd like to connect to darktable as third-party one.

To make clear to users that third-party models are not under darktable umbrella I implemented two things:

  • when adding a third-party repository there is a confirmation dialog with message "it is not maintained or reviewed by the darktable project, and a model installed from it replaces any installed model of the same name"
  • on the AI pref tab models installed from third-party repositories will have additional column showing exactly which repository it is from. This column appears only if at least one model is from third-party repo.

@andriiryzhkov

Copy link
Copy Markdown
Collaborator Author

Small addition: the source column now covers manually installed models too.

Before, only repository installs recorded an origin – a model imported from file, or a folder copied into the models directory, looked identical to an official download. A .dtmodel imported onto a catalog id even showed up as official.

Now it shows owner/repo, imported from file, or local. Still hidden when there's nothing to show.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: AI features AI features related issues and PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants