mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-03 13:52:31 +08:00
Properly load higher bit depth videos.
This commit is contained in:
parent
47ccecaee0
commit
aced236a02
@ -248,8 +248,8 @@ class VideoFromFile(VideoInput):
|
|||||||
continue
|
continue
|
||||||
if self.__duration and frame.pts >= end_pts:
|
if self.__duration and frame.pts >= end_pts:
|
||||||
break
|
break
|
||||||
img = frame.to_ndarray(format='rgb24') # shape: (H, W, 3)
|
img = frame.to_ndarray(format='gbrpf32le') # shape: (H, W, 3)
|
||||||
img = torch.from_numpy(img) / 255.0 # shape: (H, W, 3)
|
img = torch.from_numpy(img)
|
||||||
frames.append(img)
|
frames.append(img)
|
||||||
|
|
||||||
images = torch.stack(frames) if len(frames) > 0 else torch.zeros(0, 3, 0, 0)
|
images = torch.stack(frames) if len(frames) > 0 else torch.zeros(0, 3, 0, 0)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user