- Voro
- Authoring
Script FX
Script FX runs a Python function per frame, using GPU tensors in a shared Python process. Use it for an image effect you can write in Python or to bring a Python model into the graph.
The shipped analysis and generation operators that run Python models, such as Face Track, Optical Flow, Track Anything, Video Depth, Portrait Rig and Stream Diffusion, are Script FX sources shipped with their provider.
Place it
Section titled “Place it”Place Script FX from the Image view of the Voro menu. The node arrives with a docked DAT named script_fx_source. The default source copies the input to the output:
def process(ctx): ctx.outputs['out'].copy_(ctx.inputs['image'])Wire an image into image. The result is on out. ctx.inputs and ctx.outputs are the node’s ports by name.
Change the image
Section titled “Change the image”Replace the default source with this function and press Reload. It halves the RGB values while keeping alpha unchanged:
def process(ctx): image = ctx.inputs['image'] out = ctx.outputs['out'] out.copy_(image) out[..., :3].mul_(0.5)The image has height, width and channel dimensions. [..., :3] selects RGB at every pixel. Write into ctx.outputs['out'] to publish the result. This example copies the frame before changing it, so it leaves the input tensor intact. Change 0.5 to 1.0 and Reload to restore the original brightness.
Controls
Section titled “Controls”Declare a PARAMS list at the top of the source, in the same form Kernel FX uses. Each row becomes a parameter on the node, and turning one applies on the next frame without a Reload.
Reload
Section titled “Reload”Press Reload. The provider compiles the candidate and runs it. Only after the candidate has produced a frame does the node switch to it. Until then, and if it never does, the previous good script keeps running and the node reports the error.
Save it
Section titled “Save it”Save as Custom Module writes main.py and presets.json into a folder under voro_custom, and the module appears in the Custom column of the Image view. See Custom modules.
The reference page is Script FX.