diff --git a/CHANGELOG.md b/CHANGELOG.md index e76fd0df6..13fb9c654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,7 @@ Less than 2 weeks since last release, here's a service-pack style update with a - log available attention mechanisms on startup - support for switching back-and-forth **t2i** and **t2v** for *wan-2.x* models - control `api` cache controlnets + - additional model modules **deduplication** for both normal and pre-quant models: *umt5, qwen25-vl* - **Fixes** - startup error with `--profile` enabled if using `--skip` - restore orig init image for each batch sequence diff --git a/html/reference.json b/html/reference.json index a8d628145..7d573ba54 100644 --- a/html/reference.json +++ b/html/reference.json @@ -1013,9 +1013,19 @@ "size": 16.10, "extras": "" }, - "Tencent HunyuanImage 3.0": { + "nVidia ChronoEdit sdnq-svd-uint4": { + "path": "Disty0/ChronoEdit-14B-SDNQ-uint4-svd-r32", + "preview": "nvidia--ChronoEdit-14B-Diffusers.jpg", + "desc": "Quantization of nvidia/ChronoEdit-14B-Diffusers using SDNQ: sdnq-svd 4-bit uint with svd rank 32.", + "skip": true, + "tags": "quantized", + "date": "2025 October", + "size": 18.10, + "extras": "" + }, + "Tencent HunyuanImage 3.0 sdnq-svd-uint4": { "path": "Disty0/HunyuanImage3-SDNQ-uint4-svd-r32", - "desc": "HunyuanImage-3.0 is a groundbreaking native multimodal model that unifies multimodal understanding and generation within an autoregressive framework.", + "desc": "Quantization of tencent/HunyuanImage-3.0 using SDNQ: sdnq-svd 4-bit uint with svd rank 32.", "preview": "Disty0--HunyuanImage3-SDNQ-uint4-svd-r32.jpg", "extras": "", "skip": true, diff --git a/modules/lora/lora_load.py b/modules/lora/lora_load.py index f629c2772..85c66208d 100644 --- a/modules/lora/lora_load.py +++ b/modules/lora/lora_load.py @@ -13,6 +13,9 @@ available_network_aliases = {} forbidden_network_aliases = {} available_network_hash_lookup = {} dump_lora_keys = os.environ.get('SD_LORA_DUMP', None) is not None +exclude_errors = [ + "'ChronoEditTransformer3DModel'", +] def lora_dump(lora, dct): @@ -285,7 +288,8 @@ def network_load(names, te_multipliers=None, unet_multipliers=None, dyn_dims=Non shared.log.trace(f'Network load: type=LoRA active={sd_model.get_active_adapters()}') sd_model.set_adapters(adapter_names=lora_diffusers.diffuser_loaded, adapter_weights=lora_diffusers.diffuser_scales) except Exception as e: - shared.log.error(f'Network load: type=LoRA action=set {e}') + if str(e) not in exclude_errors: + shared.log.error(f'Network load: type=LoRA action=strength {str(e)}') if l.debug: errors.display(e, 'LoRA') try: @@ -294,7 +298,7 @@ def network_load(names, te_multipliers=None, unet_multipliers=None, dyn_dims=Non sd_model.unload_lora_weights() l.timer.activate += time.time() - t1 except Exception as e: - shared.log.error(f'Network load: type=LoRA action=fuse {e}') + shared.log.error(f'Network load: type=LoRA action=fuse {str(e)}') if l.debug: errors.display(e, 'LoRA') diff --git a/modules/lora/lora_overrides.py b/modules/lora/lora_overrides.py index 4d9074e0a..3ac047015 100644 --- a/modules/lora/lora_overrides.py +++ b/modules/lora/lora_overrides.py @@ -38,10 +38,12 @@ force_models_diffusers = [ # forced always 'bria', 'flite', 'cosmos', + 'chrono', # video models 'hunyuanvideo', 'cogvideo', 'wanai', + 'chrono', 'ltxvideo', 'mochivideo', 'allegrovideo', diff --git a/modules/modeldata.py b/modules/modeldata.py index 40fd3196b..2b05d8218 100644 --- a/modules/modeldata.py +++ b/modules/modeldata.py @@ -76,8 +76,10 @@ def get_model_type(pipe): elif "Allegro" in name: model_type = 'allegrovideo' # hybrid models - elif 'Wan' in name or 'ChronoEdit' in name: + elif 'Wan' in name: model_type = 'wanai' + if 'ChronoEdit' in name: + model_type = 'chrono' elif 'HDM-xut' in name: model_type = 'hdm' elif 'HunyuanImage3' in name: diff --git a/modules/sd_vae_taesd.py b/modules/sd_vae_taesd.py index 510215855..d624c5858 100644 --- a/modules/sd_vae_taesd.py +++ b/modules/sd_vae_taesd.py @@ -36,7 +36,7 @@ prev_cls = '' prev_type = '' prev_model = '' lock = threading.Lock() -supported = ['sd', 'sdxl', 'sd3', 'f1', 'h1', 'lumina2', 'hunyuanvideo', 'wanai', 'mochivideo', 'pixartsigma', 'pixartalpha', 'hunyuandit', 'omnigen', 'qwen'] +supported = ['sd', 'sdxl', 'sd3', 'f1', 'h1', 'lumina2', 'hunyuanvideo', 'wanai', 'chrono', 'mochivideo', 'pixartsigma', 'pixartalpha', 'hunyuandit', 'omnigen', 'qwen'] def warn_once(msg, variant=None): @@ -59,7 +59,7 @@ def get_model(model_type = 'decoder', variant = None): model_cls = 'sdxl' elif model_cls in {'h1', 'lumina2', 'chroma'}: model_cls = 'f1' - elif model_cls in {'wanai', 'qwen'}: + elif model_cls in {'wanai', 'qwen', 'chrono'}: variant = variant or 'TAE WanVideo' elif model_cls not in supported: warn_once(f'cls={shared.sd_model.__class__.__name__} type={model_cls} unsuppported', variant=variant) diff --git a/pipelines/model_chrono.py b/pipelines/model_chrono.py index 8eca2f47f..f240eddc3 100644 --- a/pipelines/model_chrono.py +++ b/pipelines/model_chrono.py @@ -1,3 +1,4 @@ +import sys import transformers from modules import shared, devices, sd_models, model_quant, sd_hijack_te, sd_hijack_vae from pipelines import generic @@ -19,19 +20,31 @@ def load_chrono(checkpoint_info, diffusers_load_config=None): load_args, _quant_args = model_quant.get_dit_args(diffusers_load_config, allow_quant=False) shared.log.debug(f'Load model: type=ChronoEdit repo="{repo_id}" config={diffusers_load_config} offload={shared.opts.diffusers_offload_mode} dtype={devices.dtype} args={load_args}') - from pipelines.chrono.pipeline_chronoedit import ChronoEditPipeline as pipe_cls - from pipelines.chrono.transformer_chronoedit import ChronoEditTransformer3DModel + from pipelines.chrono import pipeline_chronoedit + from pipelines.chrono import transformer_chronoedit - transformer = generic.load_transformer(repo_id, cls_name=ChronoEditTransformer3DModel, load_config=diffusers_load_config, subfolder="transformer") + # monkey patch for + import pipelines.chrono + sys.modules['chronoedit_diffusers'] = pipelines.chrono + from diffusers.pipelines import pipeline_loading_utils + pipeline_loading_utils.LOADABLE_CLASSES['chronoedit_diffusers.transformer_chronoedit'] = {} + + transformer = generic.load_transformer(repo_id, cls_name=transformer_chronoedit.ChronoEditTransformer3DModel, load_config=diffusers_load_config, subfolder="transformer") text_encoder = generic.load_text_encoder(repo_id, cls_name=transformers.UMT5EncoderModel, load_config=diffusers_load_config, subfolder="text_encoder") - pipe = pipe_cls.from_pretrained( - repo_id, - transformer=transformer, - text_encoder=text_encoder, - cache_dir=shared.opts.diffusers_dir, - **load_args, - ) + try: + pipe = pipeline_chronoedit.ChronoEditPipeline.from_pretrained( + repo_id, + transformer=transformer, + text_encoder=text_encoder, + cache_dir=shared.opts.diffusers_dir, + **load_args, + ) + except Exception as e: + import os + from modules import errors + errors.display(e, 'Chrono') + os._exit(1) pipe.postprocess = postprocess pipe.task_args = { 'num_temporal_reasoning_steps': shared.opts.model_chrono_temporal_steps,