mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
safe load non-sparse controlnet
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -36,6 +36,7 @@ TBD
|
||||
- detailer: using lora in detailer prompt
|
||||
- detailer: fail on unsupported models instead of corrputing results
|
||||
- ui: fix collapsible panels
|
||||
- control: safe load non-sparse controlnet
|
||||
|
||||
## Update for 2025-11-06
|
||||
|
||||
|
||||
@@ -353,7 +353,12 @@ class ControlNet():
|
||||
if self.dtype is not None:
|
||||
self.model.to(self.dtype)
|
||||
if self.device is not None:
|
||||
self.model.to_empty(device=self.device) # model could be sparse
|
||||
if (opts.diffusers_offload_mode != 'balanced') and hasattr(self.model, 'to'):
|
||||
try:
|
||||
self.model.to(self.device)
|
||||
except Exception as e:
|
||||
if 'Cannot copy out of meta tensor' in str(e):
|
||||
self.model.to_empty(device=self.device)
|
||||
if "Control" in opts.sdnq_quantize_weights:
|
||||
try:
|
||||
log.debug(f'Control {what} model SDNQ quantize: id="{model_id}"')
|
||||
|
||||
Reference in New Issue
Block a user