I would recommend to use the functional API as shown here, since working with the seed might be hard and yield unwanted side effects.
That being said, I’m not sure at the moment, if PIL
will accept the target images with two channels, so you might need to split the channels (or add a dummy channel to the target).