From 13519934ba4220bba47e51c185a63fc837c3d6e2 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Tue, 28 Apr 2026 13:27:42 -0700 Subject: [PATCH] Handle metadata rotation in pyav code. (#13605) --- comfy_api/latest/_input_impl/video_types.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/comfy_api/latest/_input_impl/video_types.py b/comfy_api/latest/_input_impl/video_types.py index 812b3eb30..b2daa3d7d 100644 --- a/comfy_api/latest/_input_impl/video_types.py +++ b/comfy_api/latest/_input_impl/video_types.py @@ -291,6 +291,9 @@ class VideoFromFile(VideoInput): checked_alpha = True img = frame.to_ndarray(format=image_format) # shape: (H, W, 4) + if frame.rotation != 0: + k = int(round(frame.rotation // 90)) + img = np.rot90(img, k=k, axes=(0, 1)).copy() if alphas is None: frames.append(torch.from_numpy(img)) else: