jbilcke-hf HF staff commited on
Commit
e00ae5a
1 Parent(s): 996f8c3

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -5
handler.py CHANGED
@@ -116,12 +116,12 @@ class GenerationConfig:
116
  total_pixels = self.width * self.height
117
  if total_pixels > MAX_TOTAL_PIXELS:
118
  scale = (MAX_TOTAL_PIXELS / total_pixels) ** 0.5
119
- self.width = max(32, min(MAX_LARGE_SIDE, round(self.width * scale / 32) * 32))
120
- self.height = max(32, min(MAX_LARGE_SIDE, round(self.height * scale / 32) * 32))
121
  else:
122
- # Round dimensions to nearest multiple of 32
123
- self.width = max(32, min(MAX_LARGE_SIDE, round(self.width / 32) * 32))
124
- self.height = max(32, min(MAX_LARGE_SIDE, round(self.height / 32) * 32))
125
 
126
  # Adjust number of frames to be in format 8k + 1
127
  k = (self.num_frames - 1) // 8
 
116
  total_pixels = self.width * self.height
117
  if total_pixels > MAX_TOTAL_PIXELS:
118
  scale = (MAX_TOTAL_PIXELS / total_pixels) ** 0.5
119
+ self.width = max(128, min(MAX_LARGE_SIDE, round(self.width * scale / 16) * 16))
120
+ self.height = max(128, min(MAX_LARGE_SIDE, round(self.height * scale / 16) * 16))
121
  else:
122
+ # Round dimensions to nearest multiple of 16
123
+ self.width = max(128, min(MAX_LARGE_SIDE, round(self.width / 16) * 16))
124
+ self.height = max(128, min(MAX_LARGE_SIDE, round(self.height / 16) * 16))
125
 
126
  # Adjust number of frames to be in format 8k + 1
127
  k = (self.num_frames - 1) // 8