Files
Ewald a4154ccf05 Fix P0 bugs, remove Append V2/Lens Artifacts, and fix crop reload reset
- 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.
2026-09-30 12:49:42 +02:00

34 lines
1.2 KiB
Python

"""Preview temp files must be pruned across runs, mirroring routes.py's viewmedia
cache — without this, every node execution leaves new uuid4()-named files behind
forever."""
from __future__ import annotations
from pathlib import Path
import torch
import folder_paths
from nodes import preview
def test_save_temp_images_prunes_old_files(tmp_path, monkeypatch):
monkeypatch.setattr(folder_paths, "get_temp_directory", lambda: str(tmp_path))
image = torch.zeros(1, 4, 4, 3)
for _ in range(preview._MAX_PREVIEW_CACHE_FILES + 10):
preview.save_temp_images(image, prefix="imageops_preview")
remaining = list(Path(tmp_path).glob("imageops_preview_*"))
assert len(remaining) == preview._MAX_PREVIEW_CACHE_FILES
def test_save_temp_animated_prunes_old_files(tmp_path, monkeypatch):
monkeypatch.setattr(folder_paths, "get_temp_directory", lambda: str(tmp_path))
images = torch.zeros(3, 4, 4, 3)
for _ in range(preview._MAX_PREVIEW_CACHE_FILES + 10):
preview.save_temp_animated(images, prefix="imageops_preview", ext="webp")
remaining = list(Path(tmp_path).glob("imageops_preview_*"))
assert len(remaining) == preview._MAX_PREVIEW_CACHE_FILES