How to output multiple images from Blender's compositor with Python?
You can add File Output nodes to the compositor to get multiple files saved from any point of your compositing without the need for any Python:



You can also use Python to add more nodes:

import bpy

bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree


for every_node in tree.nodes:
    tree.nodes.remove(every_node)

RenderLayers_node = tree.nodes.new('CompositorNodeRLayers')   
RenderLayers_node.location = 0,0

comp_node = tree.nodes.new('CompositorNodeComposite')   
comp_node.location = 400,0

links = tree.links
link = links.new(RenderLayers_node.outputs[0], comp_node.inputs[0])

for i in range(0,100):
    output_node = tree.nodes.new(type='CompositorNodeOutputFile')
    output_node.name = "Output node number "+str(i+1)
    output_node.location = (400,(-140-i*110)) 
    link = links.new(RenderLayers_node.outputs[0], output_node.inputs[0])


See the documentation for more info.