Predictions with arbitrairy sequence length for stateful RNN (LSTM/GRU) in Keras
I found a possible solution: You can save the weights, create a complete new model and load the weights again.

Original Stateful Model

modelinput = Input(batch_shape=(num_batches,None,num_features))
prediction = GRU(10,return_sequences=True,stateful=True)(inputs)
model = Model(inputs=modelinput,outputs=prediction)


Save Weights after Training

model.fit(...)
model.save_weights('weights.h5')


Create New Model (same structure, just not stateful and dynamic batch size)

modelinput_pred = Input(batch_shape=(None,None,num_features))
prediction_pred = GRU(10,return_sequences=True,stateful=False)(inputs_pred)
model_pred = Model(inputs=modelinput,outputs=prediction_pred)


Load Save Parameters and Predict

model_pred.load_weights('weights.h5')
model_pred.predict(...)


Nevertheless I hope for a better solution through sharing weights between a stateful GRU and a standard GRU. Is that possible?