diff options
author | cluder <1590330+cluder@users.noreply.github.com> | 2022-11-09 04:50:43 +0000 |
---|---|---|
committer | cluder <1590330+cluder@users.noreply.github.com> | 2022-11-09 04:50:43 +0000 |
commit | f37cce0e3d154f300d4ec7ed8ef6a32d1c613e50 (patch) | |
tree | 59884560de9a6462122dcab7d1a70a64c7e5ac11 /modules/api/models.py | |
parent | 3b51d239ac9201228c6032fc109111e347e8e6b0 (diff) | |
parent | ac085628540d0ec6a988fad93f5b8f2154209571 (diff) | |
download | stable-diffusion-webui-gfx803-f37cce0e3d154f300d4ec7ed8ef6a32d1c613e50.tar.gz stable-diffusion-webui-gfx803-f37cce0e3d154f300d4ec7ed8ef6a32d1c613e50.tar.bz2 stable-diffusion-webui-gfx803-f37cce0e3d154f300d4ec7ed8ef6a32d1c613e50.zip |
Merge branch 'master' of https://github.com/cluder/stable-diffusion-webui into 4448_fix_ckpt_cache
Diffstat (limited to 'modules/api/models.py')
-rw-r--r-- | modules/api/models.py | 8 |
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") + |