Skip to content

Commit

Permalink
updated models.py to enable more apis
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfeng123 committed Apr 23, 2023
1 parent b5d78c1 commit c464f29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,10 @@ def invocations(self, req: InvocationsRequest):
elif req.task == 'get-upscalers':
response = self.get_upscalers()
return response
elif req.task == 'get-samplers':
response = self.get_samplers()
return response
# useless
# elif req.task == 'get-samplers':
# response = self.get_samplers()
# return response
elif req.task == 'interrogate':
response = self.interrogateapi(req.interrogate_payload)
return response
Expand Down
3 changes: 3 additions & 0 deletions modules/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ class InvocationsRequest(BaseModel):
img2img_payload: Optional[StableDiffusionImg2ImgProcessingAPI]
extras_single_payload: Optional[ExtrasSingleImageRequest]
extras_batch_payload: Optional[ExtrasBatchImagesRequest]
progress_payload:Optional[ProgressRequest]
interrogate_payload:Optional[InterrogateRequest]
post_options_payload:Optional[]

class InvocationsErrorResponse(BaseModel):
error: str = Field(title="Invocation error", description="Error response from invocation.")
Expand Down

0 comments on commit c464f29

Please sign in to comment.