You could setup a blend file with the composite nodes setup as desired, ensuring you start from an image input node and finish with a composite node, then script setting the input and output image names.

import bpy, os
# configure input and oupt dirs
inputDir = '/tmp/input'
outputDir = '/tmp/output'
# ensure this points to the input image node - name can vary
inputNode = bpy.context.scene.node_tree.nodes['Image']
inputImages = os.listdir(inputDir)
bpy.context.scene.render.resolution_percentage = 100
for i in inputImages:
inputNode.image.filepath = os.path.join(inputDir,i)
bpy.context.scene.render.resolution_x = inputNode.image.size[0]
bpy.context.scene.render.resolution_y = inputNode.image.size[1]
bpy.context.scene.render.filepath = os.path.join(outputDir,i)
bpy.ops.render.render(write_still=True)