feat: add custom PyTorch index URL override#133
Open
Pfannkuchensack wants to merge 1 commit into
Open
Conversation
Add an optional, persisted "Custom PyTorch Index URL" setting that
overrides the torch index URL derived from Invoke's pins for all
installs and updates.
This is an advanced escape hatch for cases the pins can't cover:
- Older Nvidia GPUs (e.g. 20xx) that need a different CUDA build than
the pinned cu128 default.
- AMD on Windows, where the pins provide no rocm index at all and the
installer would otherwise silently fall back to the default index.
The override only changes the index/build - the torch version is still
pinned by the invokeai package, which is reflected in the settings hint.
Also fix the store:set-key IPC handler to delete a key when its value is
undefined instead of calling store.set(key, undefined), which throws in
electron-store ("Use delete() to clear values"). This also fixes clearing
the existing installDir key.
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.
Why
The launcher derives the PyTorch index URL from InvokeAI's
pins.json. That file exposes only a singlecuda(androcm/cpu) entry per platform, so every Nvidia GPU tier collapses onto the same index (currentlycu128). This causes two real problems the pins can't cover:cu128build doesn't work for them, so users have to manually reinstall a compatible torch build after every update — the launcher overwrites it each time with--force-reinstall.pins.jsonprovides norocmindex forwin32, so the installer silently falls back to the default PyPI index and installs a non-working (CUDA/CPU) build. There is no official ROCm-on-Windows wheel index the launcher could ship as a default.This PR adds an advanced escape hatch: a user-settable, persisted PyTorch index URL that overrides the pinned one for all installs and updates. The user takes responsibility for providing a working URL.
What changed
customTorchIndexUrl). Empty = use Invoke's default (unchanged behavior).InstallManageruses the override in place of the pins-derived index when set, and logs a clear notice when the override is active.invokeaipackage.How to test
npm run dev).https://download.pytorch.org/whl/cu126), click elsewhere to blur, close and reopen Settings → the value persists.Custom torch index URL override is active (set in Settings): <url>--index=<your-url>instead of the pinned one.pins.json(e.g.cu128) and no override line.Using torch index: default(the pre-existing gap). Set a working ROCm-Windows wheel index in the field → the install now uses it.