aboutsummaryrefslogtreecommitdiffstats
path: root/modules/api/models.py
diff options
context:
space:
mode:
authorMaiko Tan <maiko.tan.coding@gmail.com>2022-11-19 12:13:07 +0000
committerMaiko Tan <maiko.tan.coding@gmail.com>2022-11-19 12:13:07 +0000
commit336c341a7c3fe81cdf0fc45616ed0c16c79a2c6f (patch)
tree6760fd7f15a9049365a1ee2c56de37dd456504bd /modules/api/models.py
parent8f2ff861d31972d12de278075ea9c0c0deef99de (diff)
parent84a6f211d407cd748c603edc3a81862488505c24 (diff)
downloadstable-diffusion-webui-gfx803-336c341a7c3fe81cdf0fc45616ed0c16c79a2c6f.tar.gz
stable-diffusion-webui-gfx803-336c341a7c3fe81cdf0fc45616ed0c16c79a2c6f.tar.bz2
stable-diffusion-webui-gfx803-336c341a7c3fe81cdf0fc45616ed0c16c79a2c6f.zip
Merge branch 'master' into api-authorization
Diffstat (limited to 'modules/api/models.py')
-rw-r--r--modules/api/models.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/api/models.py b/modules/api/models.py
index f9cd929e..f77951fc 100644
--- a/modules/api/models.py
+++ b/modules/api/models.py
@@ -176,9 +176,9 @@ 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(