1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

stable unclip integration tests turn on memory saving (#2408)

* stable unclip integration tests turn on memory saving

* add note on turning on memory saving
This commit is contained in:
Will Berman
2023-02-18 19:24:52 -08:00
committed by GitHub
parent 55de50921f
commit 1e5eaca754
2 changed files with 12 additions and 0 deletions

View File

@@ -189,6 +189,10 @@ class StableUnCLIPPipelineIntegrationTests(unittest.TestCase):
pipe = StableUnCLIPPipeline.from_pretrained("fusing/stable-unclip-2-1-l", torch_dtype=torch.float16)
pipe.to(torch_device)
pipe.set_progress_bar_config(disable=None)
# stable unclip will oom when integration tests are run on a V100,
# so turn on memory savings
pipe.enable_attention_slicing()
pipe.enable_sequential_cpu_offload()
generator = torch.Generator(device="cpu").manual_seed(0)
output = pipe("anime turle", generator=generator, output_type="np")

View File

@@ -185,6 +185,10 @@ class StableUnCLIPImg2ImgPipelineIntegrationTests(unittest.TestCase):
)
pipe.to(torch_device)
pipe.set_progress_bar_config(disable=None)
# stable unclip will oom when integration tests are run on a V100,
# so turn on memory savings
pipe.enable_attention_slicing()
pipe.enable_sequential_cpu_offload()
generator = torch.Generator(device="cpu").manual_seed(0)
output = pipe("anime turle", image=input_image, generator=generator, output_type="np")
@@ -209,6 +213,10 @@ class StableUnCLIPImg2ImgPipelineIntegrationTests(unittest.TestCase):
)
pipe.to(torch_device)
pipe.set_progress_bar_config(disable=None)
# stable unclip will oom when integration tests are run on a V100,
# so turn on memory savings
pipe.enable_attention_slicing()
pipe.enable_sequential_cpu_offload()
generator = torch.Generator(device="cpu").manual_seed(0)
output = pipe("anime turle", image=input_image, generator=generator, output_type="np")