Update invokeai/app/invocations/baseinvocation.py

Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
This commit is contained in:
Lincoln Stein 2023-08-31 23:45:19 -04:00 committed by GitHub
parent 2cb57ef301
commit 6c2786201b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -617,11 +617,7 @@ def invocation_output(
cls.__fields__.update({"type": output_type_field})
# to support 3.9, 3.10 and 3.11, as described in https://docs.python.org/3/howto/annotations.html
annotations = (
cls.__dict__.get("__annotations__", None)
if isinstance(cls, type)
else getattr(cls, "__annotations__", None)
)
annotations = cls.__dict__.get("__annotations__", None)
if annotations:
annotations.update({"type": output_type_annotation})