grbell commited on
Commit
6bdfd36
1 Parent(s): 52d4b38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -35,7 +35,7 @@ pipe = CogVideoXImageToVideoPipeline.from_pretrained(
35
  torch_dtype=torch.bfloat16
36
  )
37
 
38
- pipe.to("cpu")
39
 
40
  pipe.vae.enable_tiling()
41
  pipe.vae.enable_slicing()
@@ -50,6 +50,13 @@ if file_name is not None:
50
  image = Image.open(file_name)
51
  col1.image(image, use_container_width=True)
52
 
 
 
 
 
 
 
 
53
  video = pipe(
54
  prompt=prompt,
55
  image=image,
@@ -57,7 +64,7 @@ if file_name is not None:
57
  num_inference_steps=50,
58
  num_frames=49,
59
  guidance_scale=6,
60
- generator=torch.Generator(device="cuda").manual_seed(42),
61
  ).frames[0]
62
 
63
  col2.video(video, use_container_width=True)
 
35
  torch_dtype=torch.bfloat16
36
  )
37
 
38
+ # pipe.to("cpu")
39
 
40
  pipe.vae.enable_tiling()
41
  pipe.vae.enable_slicing()
 
50
  image = Image.open(file_name)
51
  col1.image(image, use_container_width=True)
52
 
53
+ seed = 42
54
+
55
+ if torch.cuda.is_available():
56
+ generator = torch.Generator(device="cuda").manual_seed(seed)
57
+ else:
58
+ generator = torch.Generator().manual_seed(seed)
59
+
60
  video = pipe(
61
  prompt=prompt,
62
  image=image,
 
64
  num_inference_steps=50,
65
  num_frames=49,
66
  guidance_scale=6,
67
+ generator=generator,
68
  ).frames[0]
69
 
70
  col2.video(video, use_container_width=True)