File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -61,15 +61,21 @@ def get_outpath():
61
61
def unload_sd_model ():
62
62
from modules import shared , devices
63
63
if shared .sd_model is not None :
64
- shared .sd_model .cond_stage_model .to (devices .cpu )
65
- shared .sd_model .first_stage_model .to (devices .cpu )
64
+ if shared .sd_model .cond_stage_model is not None :
65
+ shared .sd_model .cond_stage_model .to (devices .cpu )
66
+ if shared .sd_model .first_stage_model is not None :
67
+ shared .sd_model .first_stage_model .to (devices .cpu )
68
+ # Maybe something else???
66
69
67
70
68
71
def reload_sd_model ():
69
72
from modules import shared , devices
70
73
if shared .sd_model is not None :
71
- shared .sd_model .cond_stage_model .to (devices .device )
72
- shared .sd_model .first_stage_model .to (devices .device )
74
+ if shared .sd_model .cond_stage_model is not None :
75
+ shared .sd_model .cond_stage_model .to (devices .device )
76
+ if shared .sd_model .first_stage_model :
77
+ shared .sd_model .first_stage_model .to (devices .device )
78
+ # Maybe something else???
73
79
74
80
def get_hide_dirs ():
75
81
import modules .shared
You can’t perform that action at this time.
0 commit comments