- Fix batch bypass tuple handling, memory budget device-awareness, grain RNG device, roto payload limits, preview temp-file cleanup, and route double-registration. - Add native VIDEO output (fps/audio) to effect nodes that previously only returned IMAGE/MASK when fed a VIDEO input. - Split the oversized src/preview/ops/geometry.ts and add a starting golden-fixture test harness (spherize, transform) comparing backend and frontend math. - Remove ImageOpsAppendV2 (Autogrow) and ImageOpsLensArtifacts; inline Append's helper back into its single caller. - Collapse the Color Correct curve widget behind a toggle so the node no longer grows too tall. - Fix Crop/generic-node video preview playback running at the RAF rate instead of the source video's real fps. - Fix Crop losing its saved output size after a workflow reload: syncCropWidgets recomputed height from width and a preset aspect ratio on every resync (including onConfigure on load), discarding the restored value. It now only refreshes aspect-ratio bookkeeping on a resync.
51 lines
1.5 KiB
Python
51 lines
1.5 KiB
Python
"""apply_per_frame_bypass must treat tuples the same as lists.
|
|
|
|
A non-empty tuple is always truthy in Python regardless of its contents, so the
|
|
fallback branch (`return source if bypass else processed`) silently bypassed the
|
|
whole batch for any all-False tuple before this was fixed.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import torch
|
|
|
|
from nodes._helpers import apply_per_frame_bypass
|
|
|
|
|
|
def test_all_false_tuple_returns_processed():
|
|
source = torch.zeros((3, 1, 1, 3))
|
|
processed = torch.ones((3, 1, 1, 3))
|
|
|
|
out = apply_per_frame_bypass(source, processed, (False, False, False))
|
|
|
|
assert torch.allclose(out, processed)
|
|
|
|
|
|
def test_all_true_tuple_returns_source():
|
|
source = torch.zeros((3, 1, 1, 3))
|
|
processed = torch.ones((3, 1, 1, 3))
|
|
|
|
out = apply_per_frame_bypass(source, processed, (True, True, True))
|
|
|
|
assert torch.allclose(out, source)
|
|
|
|
|
|
def test_mixed_tuple_selects_per_frame():
|
|
source = torch.zeros((3, 1, 1, 3))
|
|
processed = torch.ones((3, 1, 1, 3))
|
|
|
|
out = apply_per_frame_bypass(source, processed, (True, False, True))
|
|
|
|
assert torch.allclose(out[0], source[0])
|
|
assert torch.allclose(out[1], processed[1])
|
|
assert torch.allclose(out[2], source[2])
|
|
|
|
|
|
def test_mixed_list_still_works():
|
|
source = torch.zeros((2, 1, 1, 3))
|
|
processed = torch.ones((2, 1, 1, 3))
|
|
|
|
out = apply_per_frame_bypass(source, processed, [False, True])
|
|
|
|
assert torch.allclose(out[0], processed[0])
|
|
assert torch.allclose(out[1], source[1])
|