Yea you can. It's the same as with any other CNN based model that is not forced to have a specific shape (like transformers if they use specific positional embeddings). You can also look at the blog post where different resolution images are generated https://laion.ai/blog/paella/
Transformers are not forced to use a specific input (or output) shape; the original ViT paper demonstrates interpolating positional embeddings to inference with arbitrary image shapes.