image = pipe(prompt).images[0] In order to properly offload models after they’re called, it is required to run the entire pipeline and models are called in the pipeline’s expected order. Exercise caution if models are reused outside the context of the pipeline after hooks have been installed. See Removing Hooks for more information. enable_model_cpu_offload() is a stateful operation that installs hooks on the models and state on the pipeline.  Channels-last memory format The channels-last memory format is an alternative way of ordering NCHW tensors in memory to preserve dimension ordering. Channels-last tensors are ordered in such a way that the channels become the densest dimension (storing images pixel-per-pixel). Since not all operators currently support the channels-last format, it may result in worst performance but you should still try and see if it works for your model. For example, to set the pipeline’s UNet to use the channels-last format:   Copied print(pipe.unet.conv_out.state_dict()["weight"].stride())  # (2880, 9, 3, 1)