diff --git a/comfy/model_base.py b/comfy/model_base.py index dcfa555dc..0a87611f8 100644 --- a/comfy/model_base.py +++ b/comfy/model_base.py @@ -799,7 +799,8 @@ class StableAudio1(BaseModel): device = kwargs["device"] seconds_start = kwargs.get("seconds_start", 0) - seconds_total = kwargs.get("seconds_total", int(noise.shape[-1] / 21.53)) + ratio = self.latent_format.temporal_downscale_ratio + seconds_total = kwargs.get("seconds_total", round(noise.shape[-1] * ratio / 44100)) seconds_start_embed = self.seconds_start_embedder([seconds_start])[0].to(device) seconds_total_embed = self.seconds_total_embedder([seconds_total])[0].to(device) @@ -866,7 +867,8 @@ class StableAudio3(BaseModel): noise = kwargs.get("noise", None) device = kwargs["device"] - seconds_total = kwargs.get("seconds_total", int(noise.shape[-1] / 10.7666)) + ratio = self.latent_format.temporal_downscale_ratio + seconds_total = kwargs.get("seconds_total", round(noise.shape[-1] * ratio / 44100)) seconds_total_embed = self.seconds_total_embedder([seconds_total])[0].to(device) global_embed = seconds_total_embed.reshape((1, -1))