mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
refactor shared text encoder
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -69,26 +69,26 @@ def load_model(selected: models_def.Model):
|
||||
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:
|
||||
if selected.te_cls.__name__ == 'T5EncoderModel' and shared.opts.te_shared_te:
|
||||
selected.te = 'Disty0/t5-xxl'
|
||||
selected.te_folder = ''
|
||||
selected.te_revision = None
|
||||
if selected.te_cls.__name__ == 'UMT5EncoderModel' and shared.opts.te_shared_t5:
|
||||
if selected.te_cls.__name__ == 'UMT5EncoderModel' and shared.opts.te_shared_te:
|
||||
if 'SDNQ' in selected.name:
|
||||
selected.te = 'Disty0/Wan2.2-T2V-A14B-SDNQ-uint4-svd-r32'
|
||||
else:
|
||||
selected.te = 'Wan-AI/Wan2.2-TI2V-5B-Diffusers'
|
||||
selected.te_folder = 'text_encoder'
|
||||
selected.te_revision = None
|
||||
if selected.te_cls.__name__ == 'LlamaModel' and shared.opts.te_shared_t5:
|
||||
if selected.te_cls.__name__ == 'LlamaModel' and shared.opts.te_shared_te:
|
||||
selected.te = 'hunyuanvideo-community/HunyuanVideo'
|
||||
selected.te_folder = 'text_encoder'
|
||||
selected.te_revision = None
|
||||
if selected.te_cls.__name__ == 'Qwen2_5_VLForConditionalGeneration' and shared.opts.te_shared_t5:
|
||||
if selected.te_cls.__name__ == 'Qwen2_5_VLForConditionalGeneration' and shared.opts.te_shared_te:
|
||||
selected.te = 'ai-forever/Kandinsky-5.0-T2V-Lite-sft-5s-Diffusers'
|
||||
selected.te_folder = 'text_encoder'
|
||||
selected.te_revision = None
|
||||
if selected.te_cls.__name__ == 'Gemma3ForConditionalGeneration' and shared.opts.te_shared_t5:
|
||||
if selected.te_cls.__name__ == 'Gemma3ForConditionalGeneration' and shared.opts.te_shared_te:
|
||||
if 'SDNQ' in selected.name:
|
||||
selected.te = 'OzzyGT/LTX-2.3-sdnq-dynamic-int4'
|
||||
else:
|
||||
|
||||
@@ -37,9 +37,9 @@ def load_override(selected: Model, **load_args):
|
||||
ltx2_connectors_cls = LTX2TextConnectors
|
||||
except ImportError as e:
|
||||
log.warning(f'Video load: LTX2TextConnectors unavailable ({e}); dedup of LTX-2.3 connectors disabled')
|
||||
if ('LTXVideo 2.3' in selected.name and shared.opts.te_shared_t5 and ltx2_connectors_cls is not None):
|
||||
if ('LTXVideo 2.3' in selected.name and shared.opts.te_shared_te and ltx2_connectors_cls is not None):
|
||||
conn_repo = 'OzzyGT/LTX-2.3-sdnq-dynamic-int4' if 'SDNQ' in selected.name else 'OzzyGT/LTX-2.3'
|
||||
log.debug(f'Video load: module=connectors repo="{conn_repo}" cls={ltx2_connectors_cls.__name__} shared={shared.opts.te_shared_t5}')
|
||||
log.debug(f'Video load: module=connectors repo="{conn_repo}" cls={ltx2_connectors_cls.__name__} shared={shared.opts.te_shared_te}')
|
||||
kwargs['connectors'] = ltx2_connectors_cls.from_pretrained(
|
||||
conn_repo,
|
||||
subfolder='connectors',
|
||||
|
||||
Reference in New Issue
Block a user