inoculatemedia commited on
Commit
da84107
·
verified ·
1 Parent(s): 55f9376

Update kandinsky/t2v_pipeline.py

Browse files
Files changed (1) hide show
  1. kandinsky/t2v_pipeline.py +4 -4
kandinsky/t2v_pipeline.py CHANGED
@@ -111,9 +111,9 @@ class Kandinsky4T2VPipeline:
111
  width: int = 512,
112
  height: int = 512,
113
  seed: int = None,
114
- return_frames: bool = True
115
  ):
116
- num_steps = 8
117
 
118
  # SEED
119
  if seed is None:
@@ -135,7 +135,7 @@ class Kandinsky4T2VPipeline:
135
  if (height, width) not in self.RESOLUTIONS[self.resolution]:
136
  raise ValueError(f"Wrong height, width pair. Available (height, width) are: {self.RESOLUTIONS[self.resolution]}")
137
 
138
- if num_steps != 8:
139
  raise NotImplementedError(f"In the distilled version number of steps have to be strictly equal to 4")
140
 
141
  # PREPARATION
@@ -198,4 +198,4 @@ class Kandinsky4T2VPipeline:
198
  return_images.append(ToPILImage()(image))
199
  return return_images
200
  else:
201
- torchvision.io.write_video(save_path, 255. * images.squeeze(0).float().permute(1, 2, 3, 0).cpu().numpy(), fps=15, options = {"crf": "5"})
 
111
  width: int = 512,
112
  height: int = 512,
113
  seed: int = None,
114
+ return_frames: bool = False
115
  ):
116
+ num_steps = 4
117
 
118
  # SEED
119
  if seed is None:
 
135
  if (height, width) not in self.RESOLUTIONS[self.resolution]:
136
  raise ValueError(f"Wrong height, width pair. Available (height, width) are: {self.RESOLUTIONS[self.resolution]}")
137
 
138
+ if num_steps != 4:
139
  raise NotImplementedError(f"In the distilled version number of steps have to be strictly equal to 4")
140
 
141
  # PREPARATION
 
198
  return_images.append(ToPILImage()(image))
199
  return return_images
200
  else:
201
+ torchvision.io.write_video(save_path, 255. * images.squeeze(0).float().permute(1, 2, 3, 0).cpu().numpy(), fps=23, options = {"crf": "5"})