It seems the generator object returns a Python dict and ['image'] is indexing the 'image' key in this dict.
You could be able to check all keys via:
out = generator(to_tensor(codes))
print(out.keys())

or by checking the forward method.