mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-12 04:48:12 +02:00
Revert "Revert "Don't set the specific vram optimizations to use, instead use the new sdkit API for setting the vram usage level directly""
This reverts commit 52458ae2736256d2ed5f4f6506a5b1789e03c425.
This commit is contained in:
parent
52458ae273
commit
e2ae2715a3
@ -24,11 +24,6 @@ DEFAULT_MODELS = {
|
||||
'gfpgan': ['GFPGANv1.3'],
|
||||
'realesrgan': ['RealESRGAN_x4plus'],
|
||||
}
|
||||
VRAM_USAGE_LEVEL_TO_OPTIMIZATIONS = {
|
||||
'balanced': {'KEEP_FS_AND_CS_IN_CPU', 'SET_ATTENTION_STEP_TO_4'},
|
||||
'low': {'KEEP_ENTIRE_MODEL_IN_CPU'},
|
||||
'high': {},
|
||||
}
|
||||
MODELS_TO_LOAD_ON_START = ['stable-diffusion', 'vae', 'hypernetwork']
|
||||
|
||||
known_models = {}
|
||||
@ -133,10 +128,8 @@ def set_vram_optimizations(context: Context):
|
||||
f'possible ({max_usage_level}) on this device ({context.device}). Using "{max_usage_level}" instead')
|
||||
vram_usage_level = max_usage_level
|
||||
|
||||
vram_optimizations = VRAM_USAGE_LEVEL_TO_OPTIMIZATIONS[vram_usage_level]
|
||||
|
||||
if vram_optimizations != context.vram_optimizations:
|
||||
context.vram_optimizations = vram_optimizations
|
||||
if vram_usage_level != context.vram_usage_level:
|
||||
context.vram_usage_level = vram_usage_level
|
||||
return True
|
||||
|
||||
return False
|
||||
|
Loading…
x
Reference in New Issue
Block a user