From 77d92abf1c8736fbaef95020fa3932830d194656 Mon Sep 17 00:00:00 2001 From: City <125218114+city96@users.noreply.github.com> Date: Mon, 6 May 2024 16:36:38 +0200 Subject: [PATCH] Allow changing T5 in extra_model_paths --- README.md | 2 ++ T5/nodes.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d52875c..1f27387 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,8 @@ For faster loading/smaller file sizes, you may pick one of the following alterna - [FP16 converted version](https://huggingface.co/theunlikely/t5-v1_1-xxl-fp16/tree/main) - Same layout as the original, download both safetensor files as well as the `*.index.json` and `config.json` files. - [BF16 converter version](https://huggingface.co/city96/t5-v1_1-xxl-encoder-bf16/tree/main) - Merged into a single safetensor, only `model.safetensors` (+`config.json` for folder mode) are reqired. +To move T5 to a different drive/folder, do the same as you would when moving checkpoints, but add ` t5: t5` to `extra_model_paths.yaml` and create a directory called "t5" in the alternate path specified in the `base_path` variable. + ### Usage Loaded onto the CPU, it'll use about 22GBs of system RAM. Depending on which weights you use, it might use slightly more during loading. diff --git a/T5/nodes.py b/T5/nodes.py index 8b9e5cc..021386e 100644 --- a/T5/nodes.py +++ b/T5/nodes.py @@ -7,13 +7,15 @@ from .loader import load_t5 from ..utils.dtype import string_to_dtype # initialize custom folder path -# TODO: integrate with `extra_model_paths.yaml` os.makedirs( os.path.join(folder_paths.models_dir,"t5"), exist_ok = True, ) folder_paths.folder_names_and_paths["t5"] = ( - [os.path.join(folder_paths.models_dir,"t5")], + [ + os.path.join(folder_paths.models_dir,"t5"), + *folder_paths.folder_names_and_paths.get("t5", [[],set()])[0] + ], folder_paths.supported_pt_extensions )