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:
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user