ovi054 commited on
Commit
0636a39
·
verified ·
1 Parent(s): ee41a13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -1,14 +1,14 @@
1
  import spaces
2
  import torch
3
  from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
4
- from para_attn.first_block_cache.diffusers_adapters import apply_cache_on_pipe
5
  from PIL import Image
6
  import numpy as np
7
  import gradio as gr
8
  import os
9
 
10
 
11
- # device = "cuda" if torch.cuda.is_available() else "cpu"
12
 
13
  # model_id = "hunyuanvideo-community/HunyuanVideo"
14
 
@@ -29,11 +29,11 @@ def generate(prompt, width=832, height=832, num_inference_steps=30, lora_id=None
29
  if lora_id and lora_id.strip() != "":
30
  pipe.unload_lora_weights()
31
  pipe.load_lora_weights(lora_id.strip())
32
- apply_cache_on_pipe(
33
- pipe,
34
- # residual_diff_threshold=0.2,
35
- )
36
- pipe.to("cuda")
37
  torch.cuda.empty_cache()
38
  try:
39
  output = pipe(
 
1
  import spaces
2
  import torch
3
  from diffusers import HunyuanVideoPipeline, HunyuanVideoTransformer3DModel
4
+ # from para_attn.first_block_cache.diffusers_adapters import apply_cache_on_pipe
5
  from PIL import Image
6
  import numpy as np
7
  import gradio as gr
8
  import os
9
 
10
 
11
+ device = "cuda" if torch.cuda.is_available() else "cpu"
12
 
13
  # model_id = "hunyuanvideo-community/HunyuanVideo"
14
 
 
29
  if lora_id and lora_id.strip() != "":
30
  pipe.unload_lora_weights()
31
  pipe.load_lora_weights(lora_id.strip())
32
+ # apply_cache_on_pipe(
33
+ # pipe,
34
+ # # residual_diff_threshold=0.2,
35
+ # )
36
+ # pipe.to("cuda")
37
  torch.cuda.empty_cache()
38
  try:
39
  output = pipe(