mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
unload xformers when not used
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
import html
|
||||
import threading
|
||||
import time
|
||||
@@ -51,7 +52,8 @@ def wrap_gradio_call(func, extra_outputs=None, add_stats=False):
|
||||
if run_memmon:
|
||||
shared.mem_mon.monitor()
|
||||
t = time.perf_counter()
|
||||
|
||||
if sys.modules['xformers'] is not None and shared.opts.cross_attention_optimization != "xFormers":
|
||||
sys.modules["xformers"] = None
|
||||
try:
|
||||
if shared.cmd_opts.profile:
|
||||
pr = cProfile.Profile()
|
||||
|
||||
Reference in New Issue
Block a user