It only saves the "Combined" pass but not the Denoised image.
I haven't tried to figure out how to combine the passes via python - I thought I would ask first to see what your suggestion is to save the "DENOISED" pass when rendering from a command line batch render script?
This script will save the denoised result automatically so if you are rendering on a server or batch processing - you can save the denoised version automatically:
import bpy
scene = bpy.context.scene
# make sure we have node tree
if scene.node_tree==None:
scene.use_nodes=True
#if denoiser not enabled = no denoiser node output, so make sure it's enabled
scene.luxcore.denoiser.enabled=True
if scene.node_tree:
nodes = scene.node_tree.nodes
auto_denoise_output_label="auto_denoise_save"
# remove previously auto created denoise nodes to prevent duplicates
for node in nodes:
if node.label==auto_denoise_output_label:
nodes.remove(node)
render_layers = nodes.new("CompositorNodeRLayers")
render_layers.location=(0,0)
render_layers.label=auto_denoise_output_label
output_file = nodes.new("CompositorNodeOutputFile")
output_file.location=(200,0)
output_file.inputs[0].name="filename"
output_file.base_path = "/home/me/blender_output_path/"
output_file.file_slots[0].path="filename"
output_file.label=auto_denoise_output_label
scene.node_tree.links.new(render_layers.outputs['DENOISED'],output_file.inputs[0])