mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-01-26 19:09:45 +00:00
revise caster
This commit is contained in:
@@ -317,6 +317,8 @@ class LoadedModel:
|
||||
if mem_counter + module_mem < lowvram_model_memory:
|
||||
m.to(self.device)
|
||||
mem_counter += module_mem
|
||||
else:
|
||||
m._apply(lambda x: x.pin_memory())
|
||||
elif hasattr(m, "weight"): #only modules with ldm_patched_cast_weights can be set to lowvram mode
|
||||
m.to(self.device)
|
||||
mem_counter += module_size(m)
|
||||
|
||||
Reference in New Issue
Block a user