From 8fc9b40f2f9cb8f6f49c2dcb6482aef3f2c513e7 Mon Sep 17 00:00:00 2001 From: kylinjg Date: Sat, 13 Jun 2026 23:07:30 +0800 Subject: [PATCH] Fix UnboundLocalError: multitalk_audio_stride referenced before assignment multitalk_audio_stride is only assigned inside the `if multitalk_embeds is not None` block, but is read unconditionally later in WanVideoSampler.process. Any sampler run without multitalk_embeds (standard T2V/I2V, VACE, Fun-Control, etc.) raises: UnboundLocalError: cannot access local variable 'multitalk_audio_stride' Initialize it to None alongside the other multitalk locals. Co-Authored-By: Claude Opus 4.8 --- nodes_sampler.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nodes_sampler.py b/nodes_sampler.py index a7956341..3d206201 100644 --- a/nodes_sampler.py +++ b/nodes_sampler.py @@ -564,6 +564,7 @@ def process(self, model, image_embeds, shift, steps, cfg, seed, scheduler, rifle # MultiTalk multitalk_audio_embeds = audio_emb_slice = audio_features_in = None + multitalk_audio_stride = None multitalk_embeds = image_embeds.get("multitalk_embeds", multitalk_embeds) if multitalk_embeds is not None: