The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Lower peak mem usage for 8 bit formats with pyav. (#13626)
comfyanonymousd10fc2d65240
diff --git a/comfy_api/latest/_input_impl/video_types.py b/comfy_api/latest/_input_impl/video_types.pyindex 6ed41bba8..9a107fb76 100644--- a/comfy_api/latest/_input_impl/video_types.py+++ b/comfy_api/latest/_input_impl/video_types.py@@ -251,6 +251,7 @@ class VideoFromFile(VideoInput):container.seek(start_pts, stream=video_stream)image_format = 'gbrpf32le'+ process_image_format = lambda a: aaudio = Nonestreams = [video_stream]@@ -283,11 +284,25 @@ class VideoFromFile(VideoInput):breakif not checked_alpha:+ alpha_channel = Falsefor comp in frame.format.components:if comp.is_alpha or frame.format.name == "pal8":alphas = []- image_format = 'gbrapf32le'+ alpha_channel = Truebreak+ if frame.format.name in ("yuvj420p", "rgb24", "rgba", "pal8"):+ process_image_format = lambda a: a.float() / 255.0+ if alpha_channel:+ image_format = 'rgba'+ else:+ image_format = 'rgb24'+ else:+ process_image_format = lambda a: a+ if alpha_channel:+ image_format = 'gbrapf32le'+ else:+ image_format = 'gbrpf32le'+checked_alpha = Trueimg = frame.to_ndarray(format=image_format) # shape: (H, W, 4)@@ -323,9 +338,9 @@ class VideoFromFile(VideoInput):else:audio_frames.append(frame.to_ndarray())- images = torch.stack(frames) if len(frames) > 0 else torch.zeros(0, 0, 0, 3)+ images = process_image_format(torch.stack(frames)) if len(frames) > 0 else torch.zeros(0, 0, 0, 3)if alphas is not None:- alphas = torch.stack(alphas) if len(alphas) > 0 else torch.zeros(0, 0, 0, 1)+ alphas = process_image_format(torch.stack(alphas)) if len(alphas) > 0 else torch.zeros(0, 0, 0, 1)# Get frame rateframe_rate = Fraction(video_stream.average_rate) if video_stream.average_rate else Fraction(1)