Skip to content

Instantly share code, notes, and snippets.

@romsson
Created January 13, 2026 09:29
Show Gist options
  • Select an option

  • Save romsson/5e83ae6dbadf4175e3bbc1454a44a939 to your computer and use it in GitHub Desktop.

Select an option

Save romsson/5e83ae6dbadf4175e3bbc1454a44a939 to your computer and use it in GitHub Desktop.
import random
from ntt.frames.frame_generation import random_frame
from ntt.frames.display import display_frame
from pipeoptz import Pipeline, Node
def random_number():
num = random.randint(100, 600)
return num
pipeline = Pipeline("Simple Pipeline", "Generate a random image.")
node_gen_width = Node("GenWidth", random_number)
node_gen_height = Node("GenHeight", random_number)
node_random_frame = Node(
"random_frame", random_frame, fixed_params={"width": 10, "height": 3}
)
pipeline.add_node(node_gen_width)
pipeline.add_node(node_gen_height)
pipeline.add_node(
node_random_frame, predecessors={"width": "GenWidth", "height": "GenHeight"}
)
outputs = pipeline.run()
display_frame(outputs[1][pipeline.static_order()[-1]])
@romsson

romsson commented Jan 13, 2026

Copy link
Copy Markdown
Author
pipeline_example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment