Compare commits

..

3 Commits

Author SHA1 Message Date
Terry Jia
73ac7e6428
Merge 6cdd246966 into 667a1b8878 2026-02-01 15:57:04 +09:00
Terry Jia
6cdd246966 code improve 2026-01-20 21:28:25 -05:00
Terry Jia
c7843f888f Boundingbox widget 2026-01-15 22:25:38 -05:00

View File

@ -23,37 +23,6 @@ class ImageCrop(IO.ComfyNode):
return IO.Schema(
node_id="ImageCrop",
search_aliases=["trim"],
display_name="Image Crop (Deprecated)",
category="image/transform",
is_deprecated=True,
inputs=[
IO.Image.Input("image"),
IO.Int.Input("width", default=512, min=1, max=nodes.MAX_RESOLUTION, step=1),
IO.Int.Input("height", default=512, min=1, max=nodes.MAX_RESOLUTION, step=1),
IO.Int.Input("x", default=0, min=0, max=nodes.MAX_RESOLUTION, step=1),
IO.Int.Input("y", default=0, min=0, max=nodes.MAX_RESOLUTION, step=1),
],
outputs=[IO.Image.Output()],
)
@classmethod
def execute(cls, image, width, height, x, y) -> IO.NodeOutput:
x = min(x, image.shape[2] - 1)
y = min(y, image.shape[1] - 1)
to_x = width + x
to_y = height + y
img = image[:,y:to_y, x:to_x, :]
return IO.NodeOutput(img)
crop = execute # TODO: remove
class ImageCropV2(IO.ComfyNode):
@classmethod
def define_schema(cls):
return IO.Schema(
node_id="ImageCropV2",
search_aliases=["trim"],
display_name="Image Crop",
category="image/transform",
inputs=[
@ -77,6 +46,8 @@ class ImageCropV2(IO.ComfyNode):
img = image[:,y:to_y, x:to_x, :]
return IO.NodeOutput(img)
crop = execute # TODO: remove
class BoundingBox(IO.ComfyNode):
@classmethod
@ -684,7 +655,6 @@ class ImagesExtension(ComfyExtension):
async def get_node_list(self) -> list[type[IO.ComfyNode]]:
return [
ImageCrop,
ImageCropV2,
BoundingBox,
RepeatImageBatch,
ImageFromBatch,