Blender command line - Change input image when rendering?
You can use a script for this.


You can read command line arguments with the sys module's argv property.
Access the image filepath through the image texture node (lines 9-14).


Code:

import bpy
import sys
from os.path import isfile

# Take image path as the last command line argument
imgPath = sys.argv[-1]

o  = bpy.data.objects['Cube'] # Replace with your actual object's name
t  = o.active_material.node_tree
im = t.nodes['Image Texture'].image

#For the world texture, use something like this:

w  = bpy.data.worlds['World'] # Replace with your actual world's name
w.use_nodes = True
t  = w.node_tree
im = t.nodes['Texture'].image

# If provided image exists set is as the image texture node's image
if isfile( imgPath ): im.filepath = imgPath


Run blender with the script and provided image path thus:

blender.exe pathToBlend\scene.blend -b -P pathToScript\script.py --render-output renderPath --engine CYCLES --render-format PNG --use-extension 1 --render-frame 1 -- pathToImage\image.jpg