-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSID_QualityStandart.py
32 lines (23 loc) · 1.26 KB
/
SID_QualityStandart.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import bpy
from bpy.types import NodeTree
from .create_denoiser import create_denoiser
def create_sid_denoiser_standard() -> NodeTree:
# Create standard quality denoiser node group
prefilter_quality = 'FAST'
sid_tree: NodeTree = bpy.data.node_groups.new(type="CompositorNodeTree", name=".SuperImageDenoiser")
input_node = sid_tree.nodes.new("NodeGroupInput")
input_node.location = (-200, 0)
output_node = sid_tree.nodes.new("NodeGroupOutput")
output_node.location = (800, 0)
sid_tree.inputs.new("NodeSocketColor", "Noisy Image")
sid_tree.inputs.new("NodeSocketVector", "Denoising Normal")
sid_tree.inputs.new("NodeSocketColor", "Denoising Albedo")
# Standard Denoiser
standard_dn = create_denoiser(sid_tree, location=(0, 100), prefilter_quality=prefilter_quality)
# Link nodes
sid_tree.links.new(input_node.outputs['Noisy Image'], standard_dn.inputs[0])
sid_tree.links.new(input_node.outputs['Denoising Normal'], standard_dn.inputs[1])
sid_tree.links.new(input_node.outputs['Denoising Albedo'], standard_dn.inputs[2])
sid_tree.outputs.new("NodeSocketColor", "Denoised Image")
sid_tree.links.new(standard_dn.outputs[0], output_node.inputs["Denoised Image"])
return sid_tree