use shared llama

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-10-07 08:14:11 -04:00
parent 8e7ff09811
commit fe41d7da2a
2 changed files with 9 additions and 1 deletions
+2 -1
View File
@@ -93,7 +93,8 @@
- **xyz-grid** add guidance section
- **preview** implement configurable layers for WAN, Qwen, HV
- **Video**
- use shared T5 text encoder for video models when possible
- use shared **T5** text encoder for video models when possible
- use shared **LLama** text encoder for video models when possible
- unified video save code across all video models
also avoids creation of temporary files for each frame unless user wants to save them
- unified prompt enhance code across all video models
+7
View File
@@ -25,10 +25,17 @@ def load_model(selected: models_def.Model):
# text encoder
try:
load_args, quant_args = model_quant.get_dit_args({}, module='TE', device_map=True)
# loader deduplication of text-encoder models
if selected.te_cls.__name__ == 'T5EncoderModel' and shared.opts.te_shared_t5:
selected.te = 'Disty0/t5-xxl'
selected.te_folder = ''
selected.te_revision = None
if selected.te_cls.__name__ == 'LlamaModel' and shared.opts.te_shared_t5:
selected.te = 'hunyuanvideo-community/HunyuanVideo'
selected.te_folder = 'text_encoder'
selected.te_revision = None
shared.log.debug(f'Video load: module=te repo="{selected.te or selected.repo}" folder="{selected.te_folder}" cls={selected.te_cls.__name__} quant={model_quant.get_quant_type(quant_args)}')
kwargs["text_encoder"] = selected.te_cls.from_pretrained(
pretrained_model_name_or_path=selected.te or selected.repo,