From c7c16f805c9ea0da42d1d993f2ea7bda48beba76 Mon Sep 17 00:00:00 2001 From: AUTOMATIC1111 <16777216c@gmail.com> Date: Mon, 14 Aug 2023 09:48:40 +0300 Subject: [PATCH] repair /docs page --- modules/api/models.py | 9 +++++---- modules/processing.py | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/api/models.py b/modules/api/models.py index 800c9b93f..6a574771c 100644 --- a/modules/api/models.py +++ b/modules/api/models.py @@ -50,10 +50,12 @@ class PydanticModelGenerator: additional_fields = None, ): def field_type_generator(k, v): - # field_type = str if not overrides.get(k) else overrides[k]["type"] - # print(k, v.annotation, v.default) field_type = v.annotation + if field_type == 'Image': + # images are sent as base64 strings via API + field_type = 'str' + return Optional[field_type] def merge_class_params(class_): @@ -63,7 +65,6 @@ class PydanticModelGenerator: parameters = {**parameters, **inspect.signature(classes.__init__).parameters} return parameters - self._model_name = model_name self._class_data = merge_class_params(class_instance) @@ -72,7 +73,7 @@ class PydanticModelGenerator: field=underscore(k), field_alias=k, field_type=field_type_generator(k, v), - field_value=v.default + field_value=None if isinstance(v.default, property) else v.default ) for (k,v) in self._class_data.items() if k not in API_NOT_ALLOWED ] diff --git a/modules/processing.py b/modules/processing.py index 743666552..69d365b89 100755 --- a/modules/processing.py +++ b/modules/processing.py @@ -114,7 +114,7 @@ class StableDiffusionProcessing: prompt: str = "" prompt_for_display: str = None negative_prompt: str = "" - styles: list[str] = field(default_factory=list) + styles: list[str] = None seed: int = -1 subseed: int = -1 subseed_strength: float = 0 @@ -199,6 +199,7 @@ class StableDiffusionProcessing: print("sampler_index argument for StableDiffusionProcessing does not do anything; use sampler_name", file=sys.stderr) self.comments = {} + self.styles = [] self.sampler_noise_scheduler_override = None self.s_min_uncond = self.s_min_uncond if self.s_min_uncond is not None else opts.s_min_uncond