Commit 6c8afb2 1 parent aa6a8ac commit 6c8afb2 Copy full SHA for 6c8afb2
File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 24
24
from modules .textual_inversion .textual_inversion import create_embedding , train_embedding
25
25
from modules .hypernetworks .hypernetwork import create_hypernetwork , train_hypernetwork
26
26
from PIL import PngImagePlugin , Image
27
+ from modules .sd_models import unload_model_weights , reload_model_weights , checkpoint_aliases
27
28
from modules .sd_models_config import find_checkpoint_config_near_filename
28
29
from modules .realesrgan_model import get_realesrgan_models
29
30
from modules import devices
@@ -704,12 +705,12 @@ def interruptapi(self):
704
705
return {}
705
706
706
707
def unloadapi (self ):
707
- sd_models . unload_model_weights ()
708
+ unload_model_weights ()
708
709
709
710
return {}
710
711
711
712
def reloadapi (self ):
712
- sd_models . send_model_to_device ( shared . sd_model )
713
+ reload_model_weights ( )
713
714
714
715
return {}
715
716
@@ -729,7 +730,7 @@ def get_config(self):
729
730
730
731
def set_config (self , req : dict [str , Any ]):
731
732
checkpoint_name = req .get ("sd_model_checkpoint" , None )
732
- if checkpoint_name is not None and checkpoint_name not in sd_models . checkpoint_aliases :
733
+ if checkpoint_name is not None and checkpoint_name not in checkpoint_aliases :
733
734
raise RuntimeError (f"model { checkpoint_name !r} not found" )
734
735
735
736
for k , v in req .items ():
You can’t perform that action at this time.
0 commit comments