@@ -72,6 +72,7 @@ def __init__(self, app: FastAPI, queue_lock: Lock):
72
72
self .app .add_api_route ("/sdapi/v1/progress" , self .progressapi , methods = ["GET" ], response_model = ProgressResponse )
73
73
self .app .add_api_route ("/sdapi/v1/interrogate" , self .interrogateapi , methods = ["POST" ])
74
74
self .app .add_api_route ("/sdapi/v1/interrupt" , self .interruptapi , methods = ["POST" ])
75
+ self .app .add_api_route ("/sdapi/v1/skip" , self .skip , methods = ["POST" ])
75
76
self .app .add_api_route ("/sdapi/v1/options" , self .get_config , methods = ["GET" ], response_model = OptionsModel )
76
77
self .app .add_api_route ("/sdapi/v1/options" , self .set_config , methods = ["POST" ])
77
78
self .app .add_api_route ("/sdapi/v1/cmd-flags" , self .get_cmd_flags , methods = ["GET" ], response_model = FlagsModel )
@@ -237,6 +238,9 @@ def interruptapi(self):
237
238
238
239
return {}
239
240
241
+ def skip (self ):
242
+ shared .state .skip ()
243
+
240
244
def get_config (self ):
241
245
options = {}
242
246
for key in shared .opts .data .keys ():
@@ -248,14 +252,10 @@ def get_config(self):
248
252
249
253
return options
250
254
251
- def set_config (self , req : OptionsModel ):
252
- # currently req has all options fields even if you send a dict like { "send_seed": false }, which means it will
253
- # overwrite all options with default values.
254
- raise RuntimeError ('Setting options via API is not supported' )
255
-
256
- reqDict = vars (req )
257
- for o in reqDict :
258
- setattr (shared .opts , o , reqDict [o ])
255
+ def set_config (self , req : Dict [str , Any ]):
256
+
257
+ for o in req :
258
+ setattr (shared .opts , o , req [o ])
259
259
260
260
shared .opts .save (shared .config_filename )
261
261
return
0 commit comments