You could add
pipe.enable_attention_slicing()
before sending it to cuda, however this will reduce the speed of the image generation.
Resolution can be changed by adding height and width arguments to the image definition.
image = pipe(prompt, height=512, width=512).images[0]