MCPcopy Create free account
hub / github.com/Francis-Rings/StableAnimator / save_frames_as_png

Function save_frames_as_png

inference_basic.py:39–45  ·  view source on GitHub ↗
(frames, output_path)

Source from the content-addressed store, hash-verified

37 return images
38
39def save_frames_as_png(frames, output_path):
40 pil_frames = [Image.fromarray(frame) if isinstance(frame, np.ndarray) else frame for frame in frames]
41 num_frames = len(pil_frames)
42 for i in range(num_frames):
43 pil_frame = pil_frames[i]
44 save_path = os.path.join(output_path, f'frame_{i}.png')
45 pil_frame.save(save_path)
46
47def save_frames_as_mp4(frames, output_mp4_path, fps):
48 print("Starting saving the frames as mp4")

Callers 1

inference_basic.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected