OmPrakashSingh1704 commited on
Commit
33e0753
·
1 Parent(s): cab1be7
options/Video_model/Model.py CHANGED
@@ -54,28 +54,28 @@ def Video(
54
  video_path = os.path.join(output_folder, f"{base_count:06d}.mp4")
55
 
56
  # Perform computation with appropriate dtype based on device
57
- if device == "cuda":
58
- # Use float16 for GPU
59
- with torch.autocast(device_type='cuda', dtype=torch.float16):
60
- frames = pipeline(
61
- image, height=height, width=width,
62
- num_inference_steps=num_inference_steps,
63
- min_guidance_scale=min_guidance_scale,
64
- max_guidance_scale=max_guidance_scale,
65
- num_frames=num_frames, fps=fps, motion_bucket_id=motion_bucket_id,
66
- generator=generator,
67
- ).frames[0]
68
- else:
69
  # Use bfloat16 for CPU as it's supported in torch.autocast
70
  # with torch.autocast(device_type='cpu', dtype=torch.bfloat16):
71
- frames = pipeline(
72
- image, height=height, width=width,
73
- num_inference_steps=num_inference_steps,
74
- min_guidance_scale=min_guidance_scale,
75
- max_guidance_scale=max_guidance_scale,
76
- num_frames=num_frames, fps=fps, motion_bucket_id=motion_bucket_id,
77
- generator=generator,
78
- ).frames[0]
79
 
80
 
81
  # Save the generated video
 
54
  video_path = os.path.join(output_folder, f"{base_count:06d}.mp4")
55
 
56
  # Perform computation with appropriate dtype based on device
57
+ # if device == "cuda":
58
+ # # Use float16 for GPU
59
+ # with torch.autocast(device_type='cuda', dtype=torch.float16):
60
+ # frames = pipeline(
61
+ # image, height=height, width=width,
62
+ # num_inference_steps=num_inference_steps,
63
+ # min_guidance_scale=min_guidance_scale,
64
+ # max_guidance_scale=max_guidance_scale,
65
+ # num_frames=num_frames, fps=fps, motion_bucket_id=motion_bucket_id,
66
+ # generator=generator,
67
+ # ).frames[0]
68
+ # else:
69
  # Use bfloat16 for CPU as it's supported in torch.autocast
70
  # with torch.autocast(device_type='cpu', dtype=torch.bfloat16):
71
+ frames = pipeline(
72
+ image, height=height, width=width,
73
+ num_inference_steps=num_inference_steps,
74
+ min_guidance_scale=min_guidance_scale,
75
+ max_guidance_scale=max_guidance_scale,
76
+ num_frames=num_frames, fps=fps, motion_bucket_id=motion_bucket_id,
77
+ generator=generator,
78
+ ).frames[0]
79
 
80
 
81
  # Save the generated video
options/Video_model/__pycache__/Model.cpython-310.pyc CHANGED
Binary files a/options/Video_model/__pycache__/Model.cpython-310.pyc and b/options/Video_model/__pycache__/Model.cpython-310.pyc differ