File size: 723 Bytes
a21dee1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from pydantic import BaseModel, Field

class GenerateMaskInstruction(BaseModel):
    category: str = Field(
        ...,
        description="The editing category based on the instruction. Must be one of: Addition, Remove, Local, Global, Background."
    )
    subject: str = Field(
        ...,
        description="The subject of the editing instruction. Must be a noun in no more than 5 words."
    )
    caption: str = Field(
        ...,
        description="The detailed description of the image."
    )
    target_caption: str = Field(
        ...,
        description="Apply the editing instruction to the image caption. The target caption should describe the image after the editing instruction is applied."
    )