use 'auto' slice size

This commit is contained in:
damian 2023-01-26 17:04:22 +01:00
parent 5e7ed964d2
commit 8ed8bf52d0

View File

@ -313,8 +313,7 @@ class StableDiffusionGeneratorPipeline(StableDiffusionPipeline):
# fix is in https://github.com/kulinseth/pytorch/pull/222 but no idea when it will get merged to pytorch mainline.
pass
else:
slice_size = 4 # or 2, or 8. i chose this arbitrarily.
self.enable_attention_slicing(slice_size=slice_size)
self.enable_attention_slicing(slice_size='auto')
def image_from_embeddings(self, latents: torch.Tensor, num_inference_steps: int,