aboutsummaryrefslogtreecommitdiffstats
path: root/modules/api/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/api/models.py')
-rw-r--r--modules/api/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/api/models.py b/modules/api/models.py
index f89da1ff..34dbfa16 100644
--- a/modules/api/models.py
+++ b/modules/api/models.py
@@ -65,6 +65,7 @@ class PydanticModelGenerator:
self._model_name = model_name
self._class_data = merge_class_params(class_instance)
+
self._model_def = [
ModelDef(
field=underscore(k),
@@ -167,6 +168,12 @@ class ProgressResponse(BaseModel):
state: dict = Field(title="State", description="The current state snapshot")
current_image: str = Field(default=None, title="Current image", description="The current image in base64 format. opts.show_progress_every_n_steps is required for this to work.")
+class InterrogateRequest(BaseModel):
+ image: str = Field(default="", title="Image", description="Image to work on, must be a Base64 string containing the image's data.")
+
+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)
@@ -231,3 +238,4 @@ class ArtistItem(BaseModel):
name: str = Field(title="Name")
score: float = Field(title="Score")
category: str = Field(title="Category")
+