Python: SPG Built-In Nodes#
Not every SPG node needs a custom CUDA kernel. SPG ships built-in factory nodes that you author
with info:implementationSource = "id" and an info:id — no .cu or .cu.lua required.
This example chains two stdlib nodes: Add doubles the LdrColor AOV’s brightness by adding
it to itself (saturating at 255), then Scale downscales that result to half resolution.
“Chain two built-in SPG nodes (no custom CUDA) that brighten the color output and downscale it to half resolution, wired into a RenderProduct via info:id.”
Prerequisites#
Python 3.10-3.13
An NVIDIA RTX-capable GPU and a supported driver
Running#
uv run main.py
A successful run writes _output/input.png and _output/downscaled.png, half the input’s
width and height.
Both nodes are exact in integers, so the run rebuilds their result on the host and compares with no tolerance: a value that did not double means Add never ran, and a size that did not halve means Scale never ran. See Built-In Node Catalogue for the full catalog of built-in nodes.