Skip to content

Commit 1351993

Browse files
Handle metadata rotation in pyav code. (Comfy-Org#13605)
1 parent 24de8dc commit 1351993

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

comfy_api/latest/_input_impl/video_types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ def get_components_internal(self, container: InputContainer) -> VideoComponents:
291291
checked_alpha = True
292292

293293
img = frame.to_ndarray(format=image_format) # shape: (H, W, 4)
294+
if frame.rotation != 0:
295+
k = int(round(frame.rotation // 90))
296+
img = np.rot90(img, k=k, axes=(0, 1)).copy()
294297
if alphas is None:
295298
frames.append(torch.from_numpy(img))
296299
else:

0 commit comments

Comments
 (0)