diff options
Diffstat (limited to 'modules/api/models.py')
-rw-r--r-- | modules/api/models.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/api/models.py b/modules/api/models.py index 0ea62155..f77951fc 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,13 @@ 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.") + 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, metadata in opts.data_labels.items(): value = opts.data.get(key) @@ -231,3 +239,4 @@ class ArtistItem(BaseModel): name: str = Field(title="Name") score: float = Field(title="Score") category: str = Field(title="Category") + |