Add a MaskField primitive, and add a mask to the ConditioningField primitive type.

This commit is contained in:
Ryan Dick
2024-02-13 14:24:46 -05:00
committed by Kent Keirsey
parent 95050088d1
commit d6be7662c9
2 changed files with 52 additions and 1 deletions

View File

@ -203,6 +203,12 @@ class DenoiseMaskField(BaseModel):
gradient: bool = Field(default=False, description="Used for gradient inpainting")
class MaskField(BaseModel):
"""A mask primitive field."""
mask_name: str = Field(description="The name of a spatial mask. dtype: bool, shape: (1, h, w).")
class LatentsField(BaseModel):
"""A latents tensor primitive field"""
@ -226,7 +232,11 @@ class ConditioningField(BaseModel):
"""A conditioning tensor primitive value"""
conditioning_name: str = Field(description="The name of conditioning tensor")
# endregion
mask: Optional[MaskField] = Field(
default=None,
description="The bool mask associated with this conditioning tensor. Excluded regions should be set to False, "
"included regions should be set to True.",
)
class MetadataField(RootModel[dict[str, Any]]):