Skip to content

Commit

Permalink
Update api.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfeng123 committed Apr 24, 2023
1 parent ac698f0 commit 258577a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/api/api.py
Expand Up @@ -793,11 +793,17 @@ def invocations(self, req: InvocationsRequest):
response = self.extras_batch_images_api(req.extras_batch_payload)
response.images = self.post_invocations(response.images, quality)
return response
elif req.task == 'get-progress':
response = self.progressapi(req.progress_payload)
print("____________getting progress result: ")
print(response)
return response
elif req.task == 'set-options':
self.set_config(req.post_options_payload)
print(req.post_options_payload)
print(type(req.post_options_payload))
print("————————————settings updated———————————")
return
return "options has been set"
elif req.task == 'get-options':
response = self.get_config()
return response
Expand All @@ -820,15 +826,12 @@ def invocations(self, req: InvocationsRequest):
elif req.task == 'get-cmd-flags':
response = self.get_cmd_flags()
return response
elif req.task == 'get-progress':
response = self.progressapi(req.progress_payload)
return response
elif req.task == 'get-all-config':
response = self.get_all_config()
return response
elif req.task == 'do-nothing':
print("nothing has happened")
return
return "nothing has happened"
else:
return InvocationsErrorResponse(error = f'Invalid task - {req.task}')

Expand Down

0 comments on commit 258577a

Please sign in to comment.