fix the issue with /sdapi/v1/options failing (this time for sure!)

fix automated tests downloading CLIP model
This commit is contained in:
AUTOMATIC1111
2023-07-18 18:10:04 +03:00
parent be16d274f8
commit b270ded268
4 changed files with 5 additions and 5 deletions

View File

@@ -209,11 +209,9 @@ class PreprocessResponse(BaseModel):
fields = {}
for key, metadata in opts.data_labels.items():
value = opts.data.get(key)
if key == 'sd_model_checkpoint':
value = None
optType = opts.typemap.get(type(metadata.default), type(value))
optType = opts.typemap.get(type(metadata.default), type(metadata.default))
if isinstance(optType, types.NoneType):
if metadata.default is None:
pass
elif metadata is not None:
fields.update({key: (Optional[optType], Field(default=metadata.default, description=metadata.label))})