aboutsummaryrefslogtreecommitdiffstats
path: root/modules/api/models.py
diff options
context:
space:
mode:
authorRoy Shilkrot <roy.shil@gmail.com>2022-10-27 19:20:15 +0000
committerRoy Shilkrot <roy.shil@gmail.com>2022-10-27 19:20:15 +0000
commitbdc90837987ed8919dd611fd01553b0c170ded5c (patch)
tree075faaf3882363edd4be3bf604f18d3b6b9f1a73 /modules/api/models.py
parent737eb28faca8be2bb996ee0930ec77d1f7ebd939 (diff)
downloadstable-diffusion-webui-gfx803-bdc90837987ed8919dd611fd01553b0c170ded5c.tar.gz
stable-diffusion-webui-gfx803-bdc90837987ed8919dd611fd01553b0c170ded5c.tar.bz2
stable-diffusion-webui-gfx803-bdc90837987ed8919dd611fd01553b0c170ded5c.zip
Add a barebones interrogate API
Diffstat (limited to 'modules/api/models.py')
-rw-r--r--modules/api/models.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/api/models.py b/modules/api/models.py
index 079e33d9..8be64749 100644
--- a/modules/api/models.py
+++ b/modules/api/models.py
@@ -63,7 +63,12 @@ class PydanticModelGenerator:
self._model_name = model_name
- self._class_data = merge_class_params(class_instance)
+
+ if class_instance is not None:
+ self._class_data = merge_class_params(class_instance)
+ else:
+ self._class_data = {}
+
self._model_def = [
ModelDef(
field=underscore(k),
@@ -105,4 +110,10 @@ StableDiffusionImg2ImgProcessingAPI = PydanticModelGenerator(
"StableDiffusionProcessingImg2Img",
StableDiffusionProcessingImg2Img,
[{"key": "sampler_index", "type": str, "default": "Euler"}, {"key": "init_images", "type": list, "default": None}, {"key": "denoising_strength", "type": float, "default": 0.75}, {"key": "mask", "type": str, "default": None}, {"key": "include_init_images", "type": bool, "default": False, "exclude" : True}]
+).generate_model()
+
+InterrogateAPI = PydanticModelGenerator(
+ "Interrogate",
+ None,
+ [{"key": "image", "type": str, "default": None}]
).generate_model() \ No newline at end of file