mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
Fix balanced offload with Cascade
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
from functools import wraps, cache
|
||||
import torch
|
||||
import diffusers #0.29.1 # pylint: disable=import-error
|
||||
import diffusers # pylint: disable=import-error
|
||||
from diffusers.models.attention_processor import Attention
|
||||
|
||||
# pylint: disable=protected-access, missing-function-docstring, line-too-long
|
||||
|
||||
@@ -481,6 +481,8 @@ def apply_balanced_offload(sd_model, exclude=[]):
|
||||
keys = [k for k in keys if k not in exclude and not k.startswith('_')]
|
||||
for module_name, module_size in get_pipe_modules(pipe): # pylint: disable=protected-access
|
||||
module = getattr(pipe, module_name, None)
|
||||
if module is None:
|
||||
continue
|
||||
network_layer_name = getattr(module, "network_layer_name", None)
|
||||
device_map = getattr(module, "balanced_offload_device_map", None)
|
||||
max_memory = getattr(module, "balanced_offload_max_memory", None)
|
||||
|
||||
Reference in New Issue
Block a user