Ir para o conteúdo
Node packVerificadoExterno
Fonte aberta

ComfyUI-Olm-DragCrop

An interactive image cropping node for ComfyUI, allowing precise visual selection of crop areas directly within your workflow.

Mantenedor@o-l-l-iA · adoptionnota

Perfil do pacote

Status
Verificado
Publicador
@o-l-l-i
Fonte
GitHub

README

Olm DragCrop for ComfyUI

Olm DragDrop splash

An interactive image cropping node for ComfyUI, allowing precise visual selection of crop areas directly within your workflow. This node is designed to streamline the process of preparing images for various tasks, ensuring immediate visual feedback and control over your image dimensions.


✨ What Is This?

Olm DragCrop is a lightweight and very responsive real-time cropping node for ComfyUI, with emphasis on smooth UX. It enables you to define a crop area by dragging and resizing a box directly on your image preview within the node graph. Perfect for quickly isolating regions of interest, preparing data for complex image-based workflows, or refining image compositions.

No need to calculate pixel offsets manually or jump to external image editors – you can visually select, adjust, and apply crops without leaving ComfyUI or evaluating the graph until you're ready.

Use it for:

  • Precise visual cropping of images
  • Preparing source images for inpainting/outpainting
  • Streamlining workflows that require image dimension control

🎨 Features

  • Real-time: Fast and fluid crop box movement within the node, making it enjoyable to test different compositions.
  • Real-time Feedback: Statistics are updated instantly as you drag, with pixel dimensions and percentage displayed on the box.
  • Interactive Crop Box: Drag, move, and resize a crop box directly on the image preview within the node.
  • Visual Handles: Clearly visible handles on corners and edges for intuitive resizing.
  • Color presets: Multiple preset colors for the crop box to suit your content and taste.
  • Numeric Input Synchronization: Fine-tune crop values using synchronized numeric input widgets for Left, Right, Top, and Bottom offsets. Changes in the UI update the box, and dragging the box updates the UI.
  • Flexible Cropping: Define crop regions by drawing a new box, or by resizing/moving an existing one.
  • Mask Support: Basic mask data to pass through.
  • Aspect Ratio Locking: Define aspect ratio with numerical value (0.5, 1, 2.0) or aspect ratio (4:3, 16:9).
  • Pixel snap: Align crop edges to a grid by selecting a snap value (2-64) from the "Snap to" dropdown - select "none" to disable snapping.
  • Image Handling:
    • Loads and displays images from upstream nodes.
    • Automatically adjusts internal dimensions to match the loaded image.
    • Resets crop to full image on new image load or resolution change from backend.
  • Customization: Change the crop box color from a predefined set of options.
  • Informative Display: Toggle on/off the display of percentage and pixel dimensions directly on the crop box.
  • Smart UX:
    • Node auto-resizes to reasonably fit the image preview.
    • Handles are designed to be easily clickable, scaling with zoom for consistent interaction.
  • Persistence: Crop box position and image dimensions persist across UI and backend restarts, maintaining your last used crop settings.
  • Reset Functionality: Easily reset the crop box to the full image dimensions with a dedicated button.

📦 Installation

Clone this repository into your custom_nodes folder.

git clone https://github.com/o-l-l-i/ComfyUI-Olm-DragCrop.git

Your folder should look like:

ComfyUI/
└── custom_nodes/
    └── ComfyUI-Olm-DragCrop/
        ├── __init__.py
        ├── olm_dragcrop.py
        └── ... (other files)

Restart ComfyUI to load the new node.

There are no extra dependencies - it works out of the box.


🧪 Basic Usage

  1. Add the Olm DragCrop node from the node search menu.
  2. Connect an image source (e.g., Load Image) to the input.
  3. Run the graph once.
  4. Once a

Nós neste pacote

Nós 2
  • OlmCropInfoInterpreter
  • OlmDragCrop

Recursos relacionados

3 conexões

Fontes

3 fontes
GitHubFonteVersão 5e286e835bb6b36e610ee657e51e770a9eae207d
github.com/o-l-l-i/ComfyUI-Olm-DragCrop

Verificado 8 de out.

GitHubFonte
github.com/o-l-l-i/ComfyUI-Olm-DragCrop

Verificado 4 de nov.

Trechos de fonte

1 trecho

Source context: Repo o-l-l-i/ComfyUI-Olm-DragCrop