Skip to content

Commit 662868b

Browse files
committed
better
1 parent b5cffab commit 662868b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ def module_is_offloaded(module):
410410
pipeline_is_sequentially_offloaded = any(
411411
module_is_sequentially_offloaded(module) for _, module in self.components.items()
412412
)
413-
if pipeline_is_sequentially_offloaded and device and torch.device(device).type == "cuda":
414-
if not pipeline_has_bnb:
413+
if device and torch.device(device).type == "cuda":
414+
if pipeline_is_sequentially_offloaded and not pipeline_has_bnb:
415415
raise ValueError(
416416
"It seems like you have activated sequential model offloading by calling `enable_sequential_cpu_offload`, but are now attempting to move the pipeline to GPU. This is not compatible with offloading. Please, move your pipeline `.to('cpu')` or consider removing the move altogether if you use sequential offloading."
417417
)

0 commit comments

Comments
 (0)