---
title: "Denoiser in Katana"
canonical: "https://rmanwiki-26.pixar.com/space/RFK26/20218678/Denoiser%20in%20Katana"
format: markdown
---
![image](media://4dbe7ee5-0955-4a1b-81b4-a0be29f0e9e9)

###   
Basic Setup in Katana

<span style="color: #4269b8">**Step 1:**</span>

Add a *PrmanDenoiseChannelDefine* node to create all the DisplayChannels required for the denoiser.

<span style="color: #4269b8">**Step 2:**</span>

Add a *PrmanDenoiseRenderOutputDefine* node to output a multichannel OpenEXR file for the beauty pass. The file contains all the required denoise channels.

Set the renderLocation parameter to the location of your output image. The denoiser expects images to be in the form `<NAME>.<FRAME_NUMBER>.exr` (ex. `image.1001.exr`). In Katana you can specify the number of digits in the frame number by the number of #s in the filename (ex. `image.##.exr` would result in `image.01.exr`).

<span style="color: #4269b8">**Step 3:**</span>

Set *pixelfiltermode* to *importance* if you changed it from the default. This is done in PrmanGlobalStatements.

### Custom setup in Katana

Both the *PrmanDenoiseChannelDefine *and* PrmanDenoiseRenderOutputDefine* nodes are macros. You can command-click to see inside these macros and change settings if necessary.

If your pipeline does not support multichannel EXRs, you can use separate RenderOutputDefine nodes to create an output for each channel defined in *PrmanDenoiseChannelDefine*. Then use `$RMANTREE/bin/exrmerge` to combine the AOVs into a multichannel EXR. Use this merged multichannel EXR for the denoiser. Combined EXRs created with Katana's RenderOutputDefine merge will not work with the denoiser.

On any RenderOutputDefine nodes you create for denoising, the type should be set to "raw" to avoid any post-processing by Katana. Then make sure *asrgba* is set off so that the channel names align with what the denoiser expects.   
  


> ℹ️ See the *denoise_teapots.katana* example file in RfK's Examples directory to see how to set up denoising.


---

### Running the Denoiser:

There are several options available to denoise your Katana renders. RenderMan provides both a command line denoise tool called denoise_batch and a Denoise UI. 

#### Option 1: RenderOutputDefine Script (Single Frame)

1. Create a RenderOutputDefine.
2. Wire this node to the previous RenderOutputDefine node.
3. Set the outputName to denoise_primary by typing that in.
4. Set the type to script by selecting that option. This will cause the scriptInput parameter to show an error. Ignore that and move on to the next step.
5. Set the scriptInput to primary by selecting that option.
6. Set the scriptCommand to an expression.
7. Then enter the expression

At this point, the Render node that comes after this should have two outputs: primary (raw) and denoise_primary (script - runs on primary). 

When a Disk Render is done, the original image will be in /tmp/katana/image.1.exr and the denoised image will be in /tmp/katana/denoised/image.1.exr.


#### Option 2: command line (Crossframe or Single Frame)

Render out your images with katana --batch or katana queue. Then run the following command: 

```
$RMANTREE/bin/denoise_batch -o /path/to/directory/for/denoised/images imagename.*.exr
```

See the [Denoiser Command Line](https://renderman-26.refined.site/space/REN26/19661811/Denoiser+Command+Line) documentation for more information on the settings available.


#### Option 3: Denoise UI (Crossframe or Single Frame)

1. Render your images out of Katana as a disk or batch render.
2. The PRMan 25 shelf has a script called RenderMan Denoiser. Run this script to launch the Denoise UI. You can also access the UI directly from `$RMANTREE/bin/denoise`
3. In the UI, select "Add Directory..." and choose the directory containing the images you have rendered out of Katana.
4. Next select folder icon next to choose the directory your denoised images will be saved in.
5. Hit "start" to begin denoising.

See the [Denoiser UI](https://renderman-26.refined.site/space/REN26/19662141/Denoiser+UI) documentation for more information on the settings available.


---