Graph file format¶
Graphs are saved as JSON files with the extension .ktgraph.json.
{
"format": "klartraum-studio-graph",
"version": 1,
"nodes": [
{
"id": 1,
"kind": "scene",
"title": "Scene",
"position": [0.0, 0.0],
"params": { "path": "3rdparty/spz/samples/racoonfamily.spz", "flipY": false }
},
{
"id": 2,
"kind": "camera",
"title": "Orbit Camera",
"position": [0.0, 150.0],
"params": { "azimuth": 0.9, "elevation": -0.5, "distance": 1.0, "target": [-0.5, 0.0, 0.5], "up": "y" }
}
],
"links": [
{ "from": [1, 0], "to": [4, 0] }
]
}
Top level¶
Key |
Meaning |
|---|---|
|
Always |
|
Format version, currently |
|
The nodes of the authoring graph. |
|
The connections between node pins. |
|
The graph’s meta node definitions (optional), those used by others first. |
Nodes¶
Key |
Meaning |
|---|---|
|
Unique integer ID within the file. |
|
The node kind (see below). |
|
The title shown in the editor. |
|
Position on the canvas, |
|
The node’s parameters; which keys exist depends on the kind. Missing keys take their defaults. |
Node kinds: scene, image_file, number, time, sine, upload_number,
transform_gaussians, merge_gaussians, upload_gaussians,
make_transform, transform_gaussians_gpu, merge_gaussians_gpu, camera,
swapchain_target, offscreen_target, gaussian_splatting,
image_to_tensor, tensor_to_image, resample, onnx_model, add,
subtract, multiply, divide, relu, sigmoid, sqrt, softmax,
sd_prompt, sd_latent_noise, sd_ddim_sampler, present, preview,
image_file_writer, meta. See the Node reference for what they do. Files
with the former kinds sd_text_encoder and sd_vae_decoder load them as the
built-in meta nodes.
A meta node’s parameters name its definition and the values it sets for
exposed parameters:
"params": { "definition": "sd15_vae_decoder", "values": { "Model": "data/onnx/sd15_denoiser_256/sd15_vae_decoder.onnx" } }
Definitions¶
Each definition has a name (unique among the graph’s and the built-in
definitions), a title, a group and a description for the add-node menu,
the inner graph’s nodes and links (as above), and its interface:
Key |
Meaning |
|---|---|
|
Exposed inputs: |
|
Exposed outputs: |
|
Exposed parameters: |
Links¶
Each link connects an output pin to an input pin, written as
[node id, pin index]:
{ "from": [5, 0], "to": [6, 0] }
Graph files from before the Upload Gaussians node existed get one inserted when they are loaded.