aboutsummaryrefslogtreecommitdiff
path: root/modules/api/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/api/models.py')
-rw-r--r--modules/api/models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/api/models.py b/modules/api/models.py
index 34dbfa16..f77951fc 100644
--- a/modules/api/models.py
+++ b/modules/api/models.py
@@ -170,14 +170,15 @@ class ProgressResponse(BaseModel):
class InterrogateRequest(BaseModel):
image: str = Field(default="", title="Image", description="Image to work on, must be a Base64 string containing the image's data.")
+ model: str = Field(default="clip", title="Model", description="The interrogate model used.")
class InterrogateResponse(BaseModel):
caption: str = Field(default=None, title="Caption", description="The generated caption for the image.")
fields = {}
-for key, value in opts.data.items():
- metadata = opts.data_labels.get(key)
- optType = opts.typemap.get(type(value), type(value))
+for key, metadata in opts.data_labels.items():
+ value = opts.data.get(key)
+ optType = opts.typemap.get(type(metadata.default), type(value))
if (metadata is not None):
fields.update({key: (Optional[optType], Field(