From 6ee8d72d24b424710c432577e5ba24861077366a Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 4 Feb 2026 11:39:34 +0000 Subject: [PATCH] Fix GPUFrame wrapping in fused-pipeline fallback The fallback path was passing raw numpy/cupy arrays to GPU functions that expect GPUFrame objects with .cpu property. Co-Authored-By: Claude Opus 4.5 --- sexp_effects/primitive_libs/streaming_gpu.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sexp_effects/primitive_libs/streaming_gpu.py b/sexp_effects/primitive_libs/streaming_gpu.py index bcc3a99..3d7fa8e 100644 --- a/sexp_effects/primitive_libs/streaming_gpu.py +++ b/sexp_effects/primitive_libs/streaming_gpu.py @@ -899,7 +899,12 @@ def prim_fused_pipeline(img, effects_list, **dynamic_params): if not _FUSED_KERNELS_AVAILABLE: # Fallback: apply effects one by one - result = img + # Wrap in GPUFrame if needed (GPU functions expect GPUFrame objects) + if isinstance(img, GPUFrame): + result = img + else: + on_gpu = hasattr(img, '__cuda_array_interface__') + result = GPUFrame(img, on_gpu=on_gpu) for effect in effects_list: op = effect['op'] if op == 'rotate':