mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
Fix Kandinsky safety_checker and compile
This commit is contained in:
+1
-1
@@ -195,9 +195,9 @@ if backend == 'ipex':
|
||||
torch.cuda.get_device_properties = torch.xpu.get_device_properties
|
||||
torch._utils._get_available_device_type = lambda: "xpu"
|
||||
torch.cuda.set_device = torch.xpu.set_device
|
||||
|
||||
torch.cuda.empty_cache = torch.xpu.empty_cache if "WSL2" not in os.popen("uname -a").read() else lambda: None
|
||||
torch.cuda.ipc_collect = lambda: None
|
||||
|
||||
torch.cuda.memory_stats = torch.xpu.memory_stats
|
||||
torch.cuda.mem_get_info = lambda device=None: [(torch.xpu.get_device_properties(device).total_memory - torch.xpu.memory_allocated(device)), torch.xpu.get_device_properties(device).total_memory]
|
||||
torch.cuda.memory_allocated = torch.xpu.memory_allocated
|
||||
|
||||
@@ -521,8 +521,10 @@ class PriorPipeline:
|
||||
def __init__(self, prior, main):
|
||||
self.prior = prior
|
||||
self.main = main
|
||||
self.main.safety_checker = None
|
||||
self.scheduler = main.scheduler
|
||||
self.tokenizer = self.prior.tokenizer
|
||||
self.unet = self.main.unet
|
||||
|
||||
def to(self, *args, **kwargs):
|
||||
# only the prior is moved to CUDA in a first step
|
||||
|
||||
Reference in New Issue
Block a user