---
title: "Advanced Denoise JSON Config"
canonical: "https://rmanwiki-26.pixar.com/space/REN26/19660959/Advanced%20Denoise%20JSON%20Config"
format: markdown
---
The advanced config json file gives much greater flexibility of where the denosier reads/writes for pipelines which might need it and also provides more controls.

“Passes” describe what components you would like to denoise. For example you will normally want to create one pass for your diffuse AOVs and another for your specular AOVs.

“Settings” are global controls which affect all passes. In some cases it is also possible to overwrite these at a pass level.

This is the recommended base config to work off:

```
{
    "settings": 
    {
        "albedo": { "filename": "${InputFile}", "layer": "albedo" },
        "albedo_variance": { "filename": "${InputFile}", "layer": "albedo_mse" },

        "normal": { "filename": "${InputFile}", "layer": "normal" },
        "normal_variance": { "filename": "${InputFile}", "layer": "normal_mse" },

        "flow": { "filename": "${InputFile}", "layer": "Ci" },

        "sample_count": { "filename": "${InputFile}", "layer": "sampleCount" },

        "parameters": "${RMANTREE}/lib/denoise/20970-renderman.param",
        "topology": "${RMANTREE}/lib/denoise/full_w7_4sv2_sym_gen2.topo"
    },

    "passes": 
    [
        {
            "name": "alpha",

            "input": { "filename": "${InputFile}", "layer": "a" },
            "input_variance": { "filename": "${InputFile}", "layer": "mse" },
    
            "outputs": [
                { "read": { "filename": "${InputFile}", "layer": "a" }, "write": { "filename": "${OutputFile}", "layer": "A", "filters": [{ "type": "cutoff", "minValue": 0.0, "minCutoff": 0.00001, "maxValue": 1.0, "maxCutoff": 0.999}] } }
            ]
        },

        {
            "name": "diffuse",

            "input": { "filename": "${InputFile}", "layer": "diffuse" },
            "input_variance": { "filename": "${InputFile}", "layer": "diffuse_mse" },
    
            "outputs": [
                { "read": { "filename": "${InputFile}", "layer": "diffuse" }, "write": { "filename": "${OutputFile}", "layer": "RGB" } },
                { "read": { "filename": "${InputFile}", "layer": "diffuse" }, "write": { "filename": "${OutputFile}", "layer": "diffuse" } }
            ]
        },

        {
            "name": "specular",

            "input": { "filename": "${InputFile}", "layer": "specular" },
            "input_variance": { "filename": "${InputFile}", "layer": "specular_mse" },
    
            "outputs": [
                { "read": { "filename": "${InputFile}", "layer": "specular" }, "write": { "filename": "${OutputFile}", "layer": "RGB" } },
                { "read": { "filename": "${InputFile}", "layer": "specular" }, "write": { "filename": "${OutputFile}", "layer": "specular" } }
            ]
        }
    ]
}
```

Environment variables will be expanded inside of the any ${} symbols.

Most inputs take an AOV. This consists of a “filename” and optionally a “layer” and “filters”.

***filename - ***The file on disk*** ***to use. Normally EXR.*** ***You can use # symbols to denote frame numbers in the file for cross frame denoising.

***layer -*** The channels inside that file (for example “Ci” or “albedo”). “RGB” will use the default R, G and B channels together. RGB will also be used if layer is unset.

***filters -*** Apply simple image manipulation when the image is read or written. An example would be you may want to cutoff your alpha output to be between 0 and 1.

> ℹ️ Where variance is also required this is normally type “mse”.

# Passes

Each pass takes an input AOV (and corresponding variance AOV) to create a denoising filter. This filter can then be applied onto any other AOVs from your render to denoise (creating a less noisy approximation). You can reuse this filter for any number of AOVs, for example you may want to create a pass from your diffuse AOV and then apply this onto all the diffuse AOVs from your light groups.

***input/input_variance -*** The AOV which drives the denoising. The input AOV won’t be denoised by default, you also need to create an output for it.

***outputs -*** The list of AOVs to be denoised. Each output takes a “read” and “write” AOV corresponding to where to find the AOV and where to write the image after being denoised.

***name -*** A useful tag for debugging and inspecting the denoising process.

If two outputs “write” to the same location they images will be added together. This extremely important as it means you can denoise layers separately and then recombine for better results. At a minimum you should be aiming to denoise diffuse and specular separately. With this config you can also experiment with splitting your render further. For example into separate hair specular lobes.

# Settings

### AOVs

Files which point to your normal, normal_variance, albedo, albedo_variance and sample_count AOVs. These are reused across all pass but can also be set on the passes themselves. For example you may have a more specific specular albedo.

### Flow

The AOV used to calculate motion vectors used for cross frame denoising. Generally you would want to set this to your main render pass “Ci” but other AOVs may suffice if unavailable.

> ℹ️ You can also set "forward" and "backward" instead if you have AOVs with motion vectors but it is currently recommended to use flow.

### Frame Include/Exclude

For cross frame denoising you may want to only use or skip certain frames. It is a comma separated list which can either be frame numbers or ranges.

```
"frame-include": "1001-1008, 1012, 1013-",
"frame-exclude": "-1002, 1015"
```

### Tiles

For extremely large images you may wish to tile your denoising. Note this will increase the time required but can significantly reduce memory.

```
 "tiles": [2,2]
```

### Overwrite

Behaviour if a file is found when writing to disk. OverwriteChannels will attempt to preserve the file and simply overwrite or append any new channels to the existing file. OverwriteFile will overwrite the enter file.

```
 "overwrite": "OverwriteFile"
```

### Topology

The path to the .topo file to use. The file describes the neural network topology. For single frame denoising you'll want to use **full_w1_5s_sym_gen2.topo**. For motion blur, for best results,  it is recommended to use **full_w7_4sv2_sym_gen2.topo**. However, this requires at least 7 frames in your sequence (three before and three after the current frame). Note, both these topology files do not take asymmetry into account. If you want to use the asymmetry control, you can use **full_w1_5s_asym_gen2.topo**.

### Parameters

The path to the .param file to use. The file contains the neural network weights. If you're using the **full_w1_5s_sym_gen2.topo** topology, this should be paired with **20973-renderman.param**. For **full_w7_4sv2_sym_gen2.topo**, use **20970-renderman.param**.

### Asymmetry

Controls the asymmetry value, 0 is the best quality, and higher values encourage the denoiser to avoid overblurring, leading to weaker denoising. Values can go over 1.

> ℹ️ Not all networks support asymmetry. Your topology will have “asym” in the name if it does.