This code lets you disable nodes in the GUI but they will render fine on the farm. It is especially useful to disable several heavy nodes all at once, like motionBlur or ZDefocus.

I wrote this node while learning Python because my former company had this utility and I used it a lot. Other companies didn't have it so I wrote it myself to be able to use it whenever I needed it.
Expand Disable in GUI
import nuke
def disabledInGUI():
selected = nuke.selectedNodes()
if len(selected) == 0:
nuke.message('You have to select at least one node.')
if len(selected) > 0:
# Make a list for current states
states = []
for s in selected:
try:
states.append(s['disable'].value())
except NameError:
s['selected'].setValue(False)
selected2 = nuke.selectedNodes()
# Count how many nodes are disabled/enabled
enabled = states.count(False)
disabled = states.count(True)
# If ALL nodes are DISABLED enable them and remove animation
if enabled == 0:
for i in selected2:
i['disable'].clearAnimated()
i['disable'].setValue(False)
# If ALL nodes are ENABLED, add expression
elif disabled == 0:
for i in selected2:
i['disable'].setExpression('$gui')
# If not all the ndes are enabled or disabled, add expression
elif enabled != disabled or disabled >= 1:
for i in selected2:
i['disable'].setExpression('$gui')
# Reselect original selection
for i in selected:
i['selected'].setValue(True)