fffiloni commited on
Commit
a78ae85
1 Parent(s): fa74685

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -15
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  import os
3
  import torch
4
- from diffusers import CogVideoXPipeline, CogVideoXDPMScheduler, CogVideoXImageToVideoPipeline, CogVideoXTransformer3DModel
5
  from diffusers.utils import export_to_video, load_image
6
  from datetime import datetime
7
 
@@ -22,20 +22,9 @@ hf_hub_download(
22
  local_dir="checkpoints"
23
  )
24
 
25
- pipe = CogVideoXPipeline.from_pretrained("THUDM/CogVideoX-5b", torch_dtype=torch.bfloat16)
26
- pipe.scheduler = CogVideoXDPMScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
27
-
28
- pipe_image = CogVideoXImageToVideoPipeline.from_pretrained(
29
- "THUDM/CogVideoX-5b-I2V",
30
- transformer=CogVideoXTransformer3DModel.from_pretrained(
31
- "THUDM/CogVideoX-5b-I2V", subfolder="transformer", torch_dtype=torch.bfloat16
32
- ),
33
- vae=pipe.vae,
34
- scheduler=pipe.scheduler,
35
- tokenizer=pipe.tokenizer,
36
- text_encoder=pipe.text_encoder,
37
- torch_dtype=torch.bfloat16,
38
- )
39
  def infer(prompt, image_path, orbit_type, progress=gr.Progress(track_tqdm=True)):
40
  lora_path = "checkpoints/"
41
  if orbit_type == "Left":
 
1
  import gradio as gr
2
  import os
3
  import torch
4
+ from diffusers import CogVideoXImageToVideoPipeline
5
  from diffusers.utils import export_to_video, load_image
6
  from datetime import datetime
7
 
 
22
  local_dir="checkpoints"
23
  )
24
 
25
+ pipe = CogVideoXImageToVideoPipeline.from_pretrained("THUDM/CogVideoX-5b-I2V", torch_dtype=torch.bfloat16)
26
+ lora_path = "your lora path"
27
+ lora_rank = 256
 
 
 
 
 
 
 
 
 
 
 
28
  def infer(prompt, image_path, orbit_type, progress=gr.Progress(track_tqdm=True)):
29
  lora_path = "checkpoints/"
30
  if orbit_type == "Left":