ComfyUI Extension: ComfyUI Document Auto Crop Node
This custom node for ComfyUI automatically crops a document by detecting edges, rotates it based on face orientation using MediaPipe, and adjusts it to a target aspect ratio (default 11:14).
Custom Nodes (0)
README
š ComfyUI Document Auto Crop Node
This custom node for ComfyUI automatically crops a document by detecting edges, rotates it based on face orientation using MediaPipe, and adjusts it to a target aspect ratio (default 11:14).
⨠Features
- Document edge detection and perspective warp
- Face-aware rotation (0/90/180/270°)
- Cropping to target aspect ratio
- Lossless output with color preservation
š¦ Installation
git clone https://github.com/yourname/comfyui-document-auto-crop.git
cp -r comfyui-document-auto-crop ComfyUI/custom_nodes/
pip install -r ComfyUI/custom_nodes/comfyui-document-auto-crop/requirements.txt
š§ Usage in ComfyUI
Search for node:
š Document Auto Crop + Rotate + Ratio
Input
image
: Image input from ComfyUItarget_ratio
: Desired width/height ratio (e.g., 11/14)
Output
processed_image
: Result image after crop, rotation, and aspect adjustment