Commit dd47f79a authored by Stefy Lanza (nextime / spora )'s avatar Stefy Lanza (nextime / spora )

Merge branch 'experimental'

parents 87ed1011 1e1ea201
......@@ -10184,10 +10184,12 @@ def main(args):
# Ensure frames are in 0-255 uint8 range for video export
if isinstance(frames, np.ndarray):
if frames.dtype == np.float32 or frames.dtype == np.float64:
# Assume 0-1 range, convert to 0-255
if frames.max() <= 1.0:
frames = (frames * 255).astype(np.uint8)
else:
# Check if values are in [-1, 1] range (common for diffusion models)
if frames.min() < 0:
# Convert from [-1, 1] to [0, 1]
frames = (frames + 1.0) / 2.0
# Now convert from [0, 1] to [0, 255]
frames = np.clip(frames, 0.0, 1.0) * 255
frames = frames.astype(np.uint8)
elif frames.dtype != np.uint8:
frames = frames.astype(np.uint8)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment