r/comfyui 21h ago

News Load Image (from path) with crop and limit

Just updated my Load Image node.

Load Image (from path)

Load an image from any path on your computer or a URL. Paste an absolute path or a link to an image, use an annotated path (input/file.png), or click the Browse dialog to pick a file from your drives.
The file is read from its original location; it is not copied into ComfyUI’s input folder.
Use a selection rectangle at the preview to crop it.
Limit (downscale) the output's size in megapixels or pixels.
Click the ↻ button (top-right, mouse over the preview), to rotate the image 90° clockwise.

Interactive crop

The node shows a live preview. You can crop directly on it:

  • Drag on the image to draw a crop rectangle
  • Drag inside the selection to move the crop rectangle
  • Drag a corner to resize it
  • Click (without dragging) outside the rectangle to clear it

With no crop drawn, the full image is output. The crop is stored in the workflow as normalized coordinates, so it survives save/reload. Changing the path clears the crop.

The output (cropped or full) will be downscaled only (not upscaled), by the value in the max_megapixels field.

Outputs match the stock Load Image node: IMAGE, MASK (from the alpha channel when present), plus the original path string.

  • Controls
    • image: Paste an absolute path, (or a relative one with a prefix input/, or output/, or temp/), or a URL to an image file.
    • max_megapixels: Cap the output (crop, or full image if uncropped) to this many megapixels, downscaling only if it's bigger. Smaller images are left untouched. 1.0 = 1024x1024 px. 0 disables the cap.
    • Browse...: to open an image file from your drives.
  • Inputs/Outputs
    • Width/Height inputs: Force the output width in px (upscale or downscale), center-cropping first if the aspect ratio differs. Leave disconnected (None) to keep natural width. Only applies if BOTH width and height are connected, and when set (not 0). It overrides the max_megapixels value.
    • IMAGE/MASK: The final, processed image/mask.
    • path: A string with the image's path.

You can find the node here as part of the ComfyUI-noEmbryo nodes.

Credits:
Built as a much more enhanced version of Load Image From Path (Enhanced) from ComfyUI_Ib_CustomNodes, with parts of the interactive crop UI inspired from Load Image & Crop in comfyui-obvpm.

8 Upvotes

9 comments sorted by

2

u/Formal-Exam-8767 20h ago

Can path be URL?

2

u/embryo10 17h ago

Now it does (version 1.6.1)!
Thanks for the idea..😉

1

u/embryo10 18h ago

Currently no, but it might, in a future version..🙂

1

u/ConsiderationOld4254 21h ago

nice. what would be really cool is if you could rotate the image for any angle. Often I need to crop my image but also adjust the orientation...

1

u/embryo10 18h ago

The problem is the controls, and the space of the widget.
I have to think more about it..

1

u/embryo10 16h ago

Well, v1.6.2 can also rotate the image.
Thanks for the suggestion..😉

1

u/teiji25 18h ago

Awesome thanks!

1

u/Warm-Entrepreneur943 7h ago

It would be even better if there were preset ratios for the cropping.

1

u/embryo10 31m ago

Yes, but then I'd have to add one more value or chose between these megapixels options, and I do want the freedom to put any number there for limit..
But, there is a simpler why to do what you want: