Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -144,12 +144,12 @@ except Exception as e:
|
|
144 |
|
145 |
|
146 |
single_file_url = repo_id+"/ltx-video-2b-v0.9.1.safetensors"
|
147 |
-
text_encoder = T5EncoderModel.from_pretrained(
|
148 |
repo_id, subfolder="text_encoder", torch_dtype=torch.bfloat16
|
149 |
-
)
|
150 |
tokenizer = T5Tokenizer.from_pretrained(
|
151 |
repo_id, subfolder="tokenizer", torch_dtype=torch.bfloat16
|
152 |
-
)
|
153 |
pipe = LTXPipeline.from_single_file(
|
154 |
single_file_url,
|
155 |
text_encoder=text_encoder,
|
@@ -162,11 +162,7 @@ pipe.to("cuda")
|
|
162 |
# pipe.load_lora_weights("TODO/TODO", adapter_name="ltx-lora")
|
163 |
# pipe.set_adapters(["lrx-lora"], adapter_weights=[1.0])
|
164 |
|
165 |
-
# pipe.fuse_qkv_projections()
|
166 |
-
|
167 |
-
pipe.unet.to(memory_format=torch.channels_last)
|
168 |
pipe.vae.to(memory_format=torch.channels_last)
|
169 |
-
pipe.unet = torch.compile(pipe.unet, mode="max-autotune", fullgraph=True)
|
170 |
pipe.vae.decode = torch.compile(pipe.vae.decode, mode="max-autotune", fullgraph=True)
|
171 |
|
172 |
@spaces.GPU(duration=120)
|
|
|
144 |
|
145 |
|
146 |
single_file_url = repo_id+"/ltx-video-2b-v0.9.1.safetensors"
|
147 |
+
text_encoder = torch.compile(T5EncoderModel.from_pretrained(
|
148 |
repo_id, subfolder="text_encoder", torch_dtype=torch.bfloat16
|
149 |
+
), mode="reduce-overhead", fullgraph=True)
|
150 |
tokenizer = T5Tokenizer.from_pretrained(
|
151 |
repo_id, subfolder="tokenizer", torch_dtype=torch.bfloat16
|
152 |
+
).to(memory_format=torch.channels_last)
|
153 |
pipe = LTXPipeline.from_single_file(
|
154 |
single_file_url,
|
155 |
text_encoder=text_encoder,
|
|
|
162 |
# pipe.load_lora_weights("TODO/TODO", adapter_name="ltx-lora")
|
163 |
# pipe.set_adapters(["lrx-lora"], adapter_weights=[1.0])
|
164 |
|
|
|
|
|
|
|
165 |
pipe.vae.to(memory_format=torch.channels_last)
|
|
|
166 |
pipe.vae.decode = torch.compile(pipe.vae.decode, mode="max-autotune", fullgraph=True)
|
167 |
|
168 |
@spaces.GPU(duration=120)
|