CatFileCreator

CatFileCreator gives you the ability to create your own custom .cat files from within Nuke. It also allows you to attach user knobs to your .cat files so that you can have complete control over your machine learning models via the Inference node.

Warning:  It is important to note that not all PyTorch models work without modification. In order to correctly construct a TorchScript model from a PyTorch model please follow the guidelines laid out in the PyTorch user guide at https://pytorch.org/docs/stable/jit.html and the information provided by Foundry in the Nuke .cat File Creation Guide here: https://learn.foundry.com/nuke/developers/13.2/catfilecreationreferenceguide/index.html

Inputs and Controls

Control (UI)

Knob (Scripting)

Default Value

Function

CatFileCreator Tab

TorchScriptFile

torchScriptFileKnob

none

Specifies the file path to the .pt TorchScript model that you want to encode in the .cat file.

Cat File

catFileKnob

none

Specifies the file path to the .cat file generated from the .pt file.

Channels In

channelsInKnob

none

A comma separated list that defines the names of the input channels that your model uses.

Channels Out

channelsOuKnob

none

A comma separated list that defines the names of the output channels that your model uses.

Note:  Please refer to appendix in the Nuke CatFile Creation Reference Guide for the correct channel names and the order in which to use them.

Model ID

modelIdKnob

none

An optional user-defined ID to identify the model encoded in the .cat file.

Leaving this field blank stores an empty string in the .cat file.

Output Scale

Output Scale

1

Defines how much the width and height of the input images are scaled by the model. For example, setting the Output Scale to 1.5 would mean that you are expecting the model to scale up the input by 50% so that a 512x512 input image would create a 768x768 output.

Tip:  Click the 2 button in the Properties panel to scale the width and height independently.

Create .cat file and Inference

createCatFileKnob

N/A

Click to create a .cat file from the specified .pt file and an Inference node. The Inference node references the new .cat file automatically.

Step-by-Step Guides

Importing Pre-Trained PyTorch Models