Properly load higher bit depth videos.

pull/13542/head
comfyanonymous 2026-04-23 20:59:38 -04:00 committed by GitHub
parent 47ccecaee0
commit aced236a02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -248,8 +248,8 @@ class VideoFromFile(VideoInput):
continue
if self.__duration and frame.pts >= end_pts:
break
img = frame.to_ndarray(format='rgb24') # shape: (H, W, 3)
img = torch.from_numpy(img) / 255.0 # shape: (H, W, 3)
img = frame.to_ndarray(format='gbrpf32le') # shape: (H, W, 3)
img = torch.from_numpy(img)
frames.append(img)
images = torch.stack(frames) if len(frames) > 0 else torch.zeros(0, 3, 0, 0)