Compare commits

..

2 Commits

Author SHA1 Message Date
4c37c48b8c fix(installer): use extra index url when updating
If we don't include this, on updating, we will always get the CPU torch/torchvision/xformers.
2023-11-15 20:43:11 +11:00
0cfe2ccd9d fix: pin torch and torchvision exactly
When upgrading the app with `--extra-index-url`, torch is updated to 2.1.1, which is not an official release.

This breaks all sorts of stuff. Pin the versions exactly to avoid this.

Also pin transformers exactly while we are here.
2023-11-15 20:39:57 +11:00
4 changed files with 16 additions and 7 deletions

View File

@ -366,7 +366,7 @@ class ImagesDownloaded(BaseModel):
)
@images_router.post("/export", operation_id="download_images_from_list", response_model=ImagesDownloaded)
@images_router.post("/download", operation_id="download_images_from_list", response_model=ImagesDownloaded)
async def download_images_from_list(
image_names: list[str] = Body(description="The list of names of images to download", embed=True),
board_id: Optional[str] = Body(

View File

@ -90,6 +90,14 @@ def get_extras():
pass
return extras
def get_extra_index() -> str:
# parsed_version.local for torch is the platform + version, eg 'cu121' or 'rocm5.6'
local = pkg_resources.get_distribution("torch").parsed_version.local
if local and 'cu' in local:
return "--extra-index-url https://download.pytorch.org/whl/cu121"
if local and 'rocm' in local:
return "--extra-index-url https://download.pytorch.org/whl/rocm5.6"
return ""
def main():
versions = get_versions()
@ -122,14 +130,15 @@ def main():
branch = Prompt.ask("Enter an InvokeAI branch name")
extras = get_extras()
extra_index_url = get_extra_index()
print(f":crossed_fingers: Upgrading to [yellow]{tag or release or branch}[/yellow]")
if release:
cmd = f'pip install "invokeai{extras} @ {INVOKE_AI_SRC}/{release}.zip" --use-pep517 --upgrade'
cmd = f'pip install "invokeai{extras} @ {INVOKE_AI_SRC}/{release}.zip" --use-pep517 --upgrade {extra_index_url}'
elif tag:
cmd = f'pip install "invokeai{extras} @ {INVOKE_AI_TAG}/{tag}.zip" --use-pep517 --upgrade'
cmd = f'pip install "invokeai{extras} @ {INVOKE_AI_TAG}/{tag}.zip" --use-pep517 --upgrade {extra_index_url}'
else:
cmd = f'pip install "invokeai{extras} @ {INVOKE_AI_BRANCH}/{branch}.zip" --use-pep517 --upgrade'
cmd = f'pip install "invokeai{extras} @ {INVOKE_AI_BRANCH}/{branch}.zip" --use-pep517 --upgrade {extra_index_url}'
print("")
print("")
if os.system(cmd) == 0:

View File

@ -1543,7 +1543,7 @@ export const imagesApi = api.injectEndpoints({
components['schemas']['Body_download_images_from_list']
>({
query: ({ image_names, board_id }) => ({
url: `images/export`,
url: `images/download`,
method: 'POST',
body: {
image_names,

View File

@ -79,11 +79,11 @@ dependencies = [
"semver~=3.0.1",
"send2trash",
"test-tube~=0.7.5",
"torch~=2.1.0",
"torch==2.1.0",
"torchvision~=0.16",
"torchmetrics~=0.11.0",
"torchsde~=0.2.5",
"transformers~=4.35.0",
"transformers==4.35.1",
"uvicorn[standard]~=0.21.1",
"windows-curses; sys_platform=='win32'",
]