@@ -1125,6 +1125,22 @@ def __init__(self, id: str, display_name: str=None, optional=False, tooltip: str
11251125 def as_dict (self ):
11261126 return super ().as_dict ()
11271127
1128+ @comfytype (io_type = "IMAGECROP" )
1129+ class ImageCrop (ComfyTypeI ):
1130+ """Widget for visual image cropping with x, y, width, height controls."""
1131+ Type = dict
1132+
1133+ class Input (WidgetInput ):
1134+ def __init__ (self , id : str , display_name : str = None , optional = False , tooltip : str = None ,
1135+ socketless : bool = True ,
1136+ default : dict = None ):
1137+ super ().__init__ (id , display_name , optional , tooltip , None , default , socketless )
1138+ if default is None :
1139+ self .default = {"x" : 0 , "y" : 0 , "width" : 512 , "height" : 512 }
1140+
1141+ def as_dict (self ):
1142+ return super ().as_dict ()
1143+
11281144DYNAMIC_INPUT_LOOKUP : dict [str , Callable [[dict [str , Any ], dict [str , Any ], tuple [str , dict [str , Any ]], str , list [str ] | None ], None ]] = {}
11291145def register_dynamic_input_func (io_type : str , func : Callable [[dict [str , Any ], dict [str , Any ], tuple [str , dict [str , Any ]], str , list [str ] | None ], None ]):
11301146 DYNAMIC_INPUT_LOOKUP [io_type ] = func
@@ -1971,4 +1987,5 @@ def as_dict(self) -> dict:
19711987 "add_to_dict_v3" ,
19721988 "V3Data" ,
19731989 "ImageCompare" ,
1990+ "ImageCrop" ,
19741991]
0 commit comments