disable memory

This commit is contained in:
lllyasviel 2023-10-17 23:56:20 -07:00
parent 78c78cca72
commit e5f614c14e
2 changed files with 13 additions and 11 deletions

View File

@ -1 +1 @@
version = '2.1.698'
version = '2.1.699'

View File

@ -517,17 +517,19 @@ def build_loaded(module, loader_name):
return
def disable_smart_memory():
print(f'[Fooocus] Disabling smart memory')
fcbh.model_management.DISABLE_SMART_MEMORY = True
args_manager.args.disable_smart_memory = True
fcbh.cli_args.args.disable_smart_memory = True
return
def patch_all():
if not fcbh.model_management.DISABLE_SMART_MEMORY:
vram_inadequate = fcbh.model_management.total_vram < 20 * 1024
is_old_gpu_arch = not fcbh.model_management.should_use_fp16()
if vram_inadequate or is_old_gpu_arch:
# https://github.com/lllyasviel/Fooocus/issues/602
print(f'[Fooocus Smart Memory] Disabling smart memory, '
f'vram_inadequate = {vram_inadequate}, is_old_gpu_arch = {is_old_gpu_arch}.')
fcbh.model_management.DISABLE_SMART_MEMORY = True
args_manager.args.disable_smart_memory = True
fcbh.cli_args.args.disable_smart_memory = True
# Many recent reports show that Comfyanonymous's method is still not robust enough and many 4090s are broken
# We will not use it until this method is really usable
# For example https://github.com/lllyasviel/Fooocus/issues/724
disable_smart_memory()
if not hasattr(fcbh.model_management, 'load_models_gpu_origin'):
fcbh.model_management.load_models_gpu_origin = fcbh.model_management.load_models_gpu