Official repository for LTX-Video
Python diffusion-modelsditimage-to-videoimage-to-video-generationtext-to-videotext-to-video-generation
Pipeline: Encode the negative prompt only once
Yoav HaCohencf59f5e39081
diff --git a/ltx_video/pipelines/pipeline_ltx_video.py b/ltx_video/pipelines/pipeline_ltx_video.pyindex aadded3..836af84 100644--- a/ltx_video/pipelines/pipeline_ltx_video.py+++ b/ltx_video/pipelines/pipeline_ltx_video.py@@ -341,8 +341,8 @@ class LTXVideoPipeline(DiffusionPipeline):# get unconditional embeddings for classifier free guidanceif do_classifier_free_guidance and negative_prompt_embeds is None:- uncond_tokens = [negative_prompt] * batch_size- uncond_tokens = self._text_preprocessing(uncond_tokens)+ uncond_tokens = self._text_preprocessing(negative_prompt)+ uncond_tokens = uncond_tokens * batch_sizemax_length = prompt_embeds.shape[1]uncond_input = self.tokenizer(uncond_tokens,