From 107bb05f17fad74e711593c6a335e1ffc70180d6 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Wed, 8 Apr 2026 20:05:44 +0200 Subject: [PATCH] fix(vae-roundtrip): pass bigvgan path to encoder-only FeaturesUtils AutoEncoderModule unconditionally asserts vocoder_ckpt_path is not None even when need_vae_encoder=True. Pass best_netG.pt to satisfy the assert; the vocoder weights are not actually used since decode+vocode go through model["feature_utils"]. Co-Authored-By: Claude Sonnet 4.6 --- nodes/selva_vae_roundtrip.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nodes/selva_vae_roundtrip.py b/nodes/selva_vae_roundtrip.py index 1152e0e..d563459 100644 --- a/nodes/selva_vae_roundtrip.py +++ b/nodes/selva_vae_roundtrip.py @@ -63,13 +63,17 @@ class SelvaVaeRoundtrip: ) # Load encoder only — decoder/vocoder come from model["feature_utils"] - # to mirror exactly what the sampler uses + # to mirror exactly what the sampler uses. + # AutoEncoderModule requires vocoder_ckpt_path even when only encoding, + # so pass the BigVGAN path (weights won't actually be used for decode here). + bigvgan_path = _SELVA_DIR / "ext" / "best_netG.pt" print("[VAE Roundtrip] Loading VAE encoder...", flush=True) vae_enc = FeaturesUtils( tod_vae_ckpt=str(vae_path), enable_conditions=False, mode=mode, need_vae_encoder=True, + bigvgan_vocoder_ckpt=str(bigvgan_path) if bigvgan_path.exists() else None, ).to(device).eval() try: