Skip to content

Commit

Permalink
repair /docs page
Browse files Browse the repository at this point in the history
  • Loading branch information
AUTOMATIC1111 committed Aug 14, 2023
1 parent f37cc5f commit c7c16f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions modules/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ def __init__(
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_):
Expand All @@ -63,7 +65,6 @@ def merge_class_params(class_):
parameters = {**parameters, **inspect.signature(classes.__init__).parameters}
return parameters


self._model_name = model_name
self._class_data = merge_class_params(class_instance)

Expand All @@ -72,7 +73,7 @@ def merge_class_params(class_):
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
]
Expand Down
3 changes: 2 additions & 1 deletion modules/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -199,6 +199,7 @@ def __post_init__(self):
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
Expand Down

0 comments on commit c7c16f8

Please sign in to comment.