mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-04-30 11:11:15 +00:00
revise caster
This commit is contained in:
@@ -317,6 +317,8 @@ class LoadedModel:
|
|||||||
if mem_counter + module_mem < lowvram_model_memory:
|
if mem_counter + module_mem < lowvram_model_memory:
|
||||||
m.to(self.device)
|
m.to(self.device)
|
||||||
mem_counter += module_mem
|
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
|
elif hasattr(m, "weight"): #only modules with ldm_patched_cast_weights can be set to lowvram mode
|
||||||
m.to(self.device)
|
m.to(self.device)
|
||||||
mem_counter += module_size(m)
|
mem_counter += module_size(m)
|
||||||
|
|||||||
Reference in New Issue
Block a user