refactor: remove mm_config parameter from LightX2V configuration files for cleaner implementation and improved clarity

This commit is contained in:
gaclove
2025-10-26 15:28:12 +00:00
parent 3bc7986638
commit 8a575afae6
3 changed files with 10 additions and 8 deletions
-1
View File
@@ -129,7 +129,6 @@ class LightX2VDefaultConfig:
"t5_quant_scheme": DEFAULT_QUANTIZATION_SCHEMES["t5"],
"clip_quant_scheme": DEFAULT_QUANTIZATION_SCHEMES["clip"],
"adapter_quant_scheme": DEFAULT_QUANTIZATION_SCHEMES["adapter"],
"mm_config": {"mm_type": "Default"},
# Memory Optimization
"rotary_chunk": False,
"rotary_chunk_size": 100,
-1
View File
@@ -313,7 +313,6 @@ class ConfigBuilder:
"t5_quantized": getattr(config, "t5_quantized", False),
"clip_quantized": getattr(config, "clip_quantized", False),
"lora_configs": getattr(config, "lora_configs", None),
"mm_config": getattr(config, "mm_config", None),
"cross_attn_1_type": getattr(config, "cross_attn_1_type", None),
"cross_attn_2_type": getattr(config, "cross_attn_2_type", None),
"self_attn_1_type": getattr(config, "self_attn_1_type", None),
+10 -6
View File
@@ -1117,12 +1117,16 @@ class LightX2VConfigCombinerV2:
logging.warning(f"Mask file not found: {obj['mask']}")
if processed_talk_objects:
# config.talk_objects = processed_talk_objects
temp_dir = self.temp_manager.create_temp_dir()
with open(os.path.join(temp_dir, "config.json"), "w") as f:
json.dump({"talk_objects": processed_talk_objects}, f)
config.audio_path = temp_dir
logging.info(f"Processed {len(processed_talk_objects)} talk objects")
if len(processed_talk_objects) == 1:
if "mask" not in processed_talk_objects[0]:
config.audio_path = processed_talk_objects[0]["audio"]
logging.info(f"Convert Processed 1 talk object to audio path: {config.audio_path}")
else:
temp_dir = self.temp_manager.create_temp_dir()
with open(os.path.join(temp_dir, "config.json"), "w") as f:
json.dump({"talk_objects": processed_talk_objects}, f)
config.audio_path = temp_dir
logging.info(f"Processed {len(processed_talk_objects)} talk objects")
logging.info("lightx2v prepared config: " + json.dumps(config, indent=2, ensure_ascii=False))