ComfyUI lab 8: Prototype frame transforms safely
Understand image tensor shape, range, batch semantics, and the boundary between a prototype code block and a maintained node.
Listen to this article
On-device voiceUses the voice built into your browser; no article text leaves this page.
Audio narration is not supported by this browser.
The frame preset block makes tensor behavior visible without turning a public workflow into a Python execution surface. Each frame becomes a bounded H × W × 3 float array, a reviewed operation transforms it, and the node rejects shape changes before stacking the batch.
Start with invariants
The identity preset must round-trip. Then test a constant gray image, pure channel patches, portrait and landscape dimensions, and a multi-frame batch. The included grayscale-pop preset mixes luminance with a contrast lift while preserving the original shape.
Maintained operations stay vectorized over whole arrays. Watch temporary allocations on long frame batches: three extra 4K float arrays can consume hundreds of megabytes.
The security boundary is real
The hosted block does not execute workflow-supplied Python. Unknown operations fail closed; the shader companion accepts only bounded arithmetic over declared channels and functions. Add a new preset in reviewed source with tests, dependency bounds, and a license before exposing it through an API.
Use this lab to understand batches, shapes, ranges, CPU/GPU transfers, and failure messages, then graduate any successful experiment into a named maintained operation.
Run the lab
- Open this graph in Comfy Studio
- Download the exact API-format workflow
- CLI:
app comfy download python-frame-transform
Record the graph JSON, input assets, seed where relevant, model or service version, custom-node commit, and final artifact together. That bundle—not a screenshot—is the reproducible creative unit.
Open-source map
- Open frame block — MIT frame-transform prototype node
- ComfyUI core — Core node and IMAGE tensor contracts
Creative Systems Labs: 8 of 12. Previous: Write inspectable shader looks Next: Control Z-Image with line structure