feat: conditionally apply guidance_scale=1.0 when Turbo LoRA is loaded in ref2va_step3.py
This commit is contained in:
+4
-1
@@ -238,11 +238,13 @@ def main():
|
||||
first_task = TASK_REGISTRY[first_idx] if first_idx is not None else None
|
||||
effective_steps = first_task.num_inference_steps if first_task and first_task.num_inference_steps is not None else RUN_CONFIG.get("default_num_inference_steps", 8)
|
||||
|
||||
use_turbo_guidance = False
|
||||
if effective_steps <= 23:
|
||||
lora_path = os.path.join(MODELS_DIR, "loras/minimax_h3_turbo_v4_step600_ema.safetensors")
|
||||
if os.path.exists(lora_path):
|
||||
print(f">> [LoRA] 檢測到步驟 {effective_steps} <= 23, 載入 Turbo LoRA: {os.path.basename(lora_path)}")
|
||||
pipe.load_lora(pipe.dit, lora_config=lora_path, alpha=1.0, verbose=1)
|
||||
use_turbo_guidance = True
|
||||
else:
|
||||
print(f">> [Warning] LoRA 檔案不存在: {lora_path}")
|
||||
else:
|
||||
@@ -322,6 +324,7 @@ def main():
|
||||
num_frames=task.num_frames,
|
||||
num_inference_steps=steps,
|
||||
seed=seed,
|
||||
**({'guidance_scale': 1.0} if use_turbo_guidance else {}),
|
||||
)
|
||||
|
||||
# --- 任務完成:抓取本次任務的 VRAM 峰值 ---
|
||||
@@ -365,4 +368,4 @@ def main():
|
||||
print(f"\n========== [REF2VA STAGE 3] 全部任務完成 ==========")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
main()
|
||||
Reference in New Issue
Block a user