How to use ImageDataGenerator with class_weights argument in fit method?

I am working on a multi-class classification problem with an imbalanced dataset.

I am using ImageDataGenerator.flow_from_dataframe method. Which requires class labels to in str, list or tuple format while the class_weight argument in fit method requires a dictionary with keys in int format.

How can I implement this?