Converting keras.datasets example code to use batches

I’ve finished part one of the course, and I’m trying to move forward with learning more techniques and models.

I’m working on doing a GAN tutorial that uses MNIST from keras.datasets. It’s really cool, but I’d like to alter it to work with my own dataset using batches from ImageDataGenerator (in grayscale mode). I’m having a bit of trouble altering my code from the mnist input, which loads everything into an array, to use the batches as input. Specifically I’m wondering how to pull data out of the batch so that I can concatenate it with the “generated image” from the generator model.

I’ve tried a few things to get the input data set up correctly, but nothing has worked well enough that I think it’s worthy of putting in this post.

Does anyone have any experience doing this, and have any advice to offer?