diff --git a/conditioning.py b/conditioning.py index 76ae368a..6093fdee 100644 --- a/conditioning.py +++ b/conditioning.py @@ -182,12 +182,19 @@ def latent_sample_type_name(latent): samples = latent.get("samples") if samples is None: return "missing samples" - return f"{type(samples).__module__}.{type(samples).__name__}" + shape = tuple(samples.shape) if isinstance(samples, torch.Tensor) else "unknown" + return f"{type(samples).__module__}.{type(samples).__name__}, shape={shape}" def latent_is_plain_video_tensor(latent): samples = latent_samples(latent) - return samples is not None and latent.get("type") != "audio" + if samples is None: + return False + if samples.dim() == 5: + return True + if samples.dim() == 4 and latent.get("type") != "audio": + return True + return False def cpu_tensor_bundle(latent): diff --git a/docs/FunPackGemmaEmbeddingRefiner.md b/docs/FunPackGemmaEmbeddingRefiner.md index cdc711dc..f7bfb043 100644 --- a/docs/FunPackGemmaEmbeddingRefiner.md +++ b/docs/FunPackGemmaEmbeddingRefiner.md @@ -68,6 +68,8 @@ For LTX audio/video workflows, the latent path must use video latents only: Do not connect the combined AV latent from `LTXVConcatAVLatent`, the sampler AV output, or the audio latent to this node. Those use LTX nested/audio latent structures and are intentionally rejected with a clear error. +Some LTX separated video latents keep `type: audio` metadata even after `LTXVSeparateAVLatent`; the node accepts those when their `samples` tensor is the 5D video tensor shape. + Latent refinement follows the connection state exactly: - If the latent input is disconnected and `refined_latent` is disconnected, latent tweaking is disabled. diff --git a/docs/FunPackSaveRefinementLatent.md b/docs/FunPackSaveRefinementLatent.md index c3506309..84c01a49 100644 --- a/docs/FunPackSaveRefinementLatent.md +++ b/docs/FunPackSaveRefinementLatent.md @@ -20,4 +20,4 @@ This node saves a latent tensor bundle under a refinement key so `FunPack Video The saved latent lives in FunPack's local `refinements` folder as a PyTorch tensor file. The refiner only uses it when both the key and mode match and the `refined_latent` output is connected. If the refiner receives a latent and no saved reference exists, it saves the incoming latent automatically. Zero-valued latent positions are treated as intentional and are not refined. -Audio latents and LTX audio/video combined `NestedTensor` latents are intentionally rejected. Use only the video latent side, then reconnect the refined result to `LTXVConcatAVLatent` as `video_latent`. +Audio latents and LTX audio/video combined `NestedTensor` latents are intentionally rejected. Use only the video latent side, then reconnect the refined result to `LTXVConcatAVLatent` as `video_latent`. If a separated LTX video latent still reports `type: audio`, it is accepted when its `samples` tensor has the 5D video latent shape.