diff --git a/README.md b/README.md index 5f6ff9b..4a7aafb 100644 --- a/README.md +++ b/README.md @@ -1 +1,64 @@ -# ComfyUI-Resolution-Divider \ No newline at end of file +# ComfyUI-Resolution-Divider + +A smart utility node for **ComfyUI** designed to calculate downscaled resolutions while strictly maintaining the original aspect ratio. + +This node is essential for **Image-to-Video (I2V)** workflows (like **Wan 2.2**), where using high-resolution input images often leads to **OOM (Out of Memory)** errors. It helps you find the "sweet spot" (e.g., 480p or 720p) instantly without manual calculations. + +![Node Screenshot](path_to_your_screenshot.png) + +## ๐Ÿš€ Key Features + +* **Smart Parsing:** Accepts various format inputs like `1920x1080`, `1920 1080`, or `1920, 1080`. +* **Auto-Detect Resolution:** Select an image from your input folder or **upload one directly** on the node. It automatically reads the dimensions. +* **Real-Time Calculation:** The "Live Result" updates instantly via JavaScript as you adjust the sliderโ€”no need to queue the prompt to see the numbers. +* **VRAM Saver:** Perfect for downscaling 4K/HD images to manageable sizes for heavy models (Wan 2.2, Kling, etc.) without making the image "squashed" or "stretched". +* **Clean UI:** Optimized widget layout for a smooth user experience. + +## ๐Ÿ“ฆ Installation + +### Method 1: Manual Clone +1. Navigate to your ComfyUI `custom_nodes` directory. +2. Open a terminal/command prompt. +3. Run the following command: + ```bash + git clone https://github.com/CraftBlack/ComfyUI-Resolution-Divider.git + ``` +4. Restart ComfyUI. + +### Method 2: ComfyUI Manager +*Coming soon... (Once registered in the index)* + +## ๐Ÿ› ๏ธ Usage + +1. **Add the Node:** + * Right-click canvas -> `Add Node` -> `Resolution Utils` -> `Resolution Divider (VRAM Saver)`. +2. **Input:** + * **Option A:** Type the resolution manually in `res_string` (e.g., `1024x1024`). + * **Option B:** Click "Upload" or select an image from the dropdown. The node will auto-fill the resolution. +3. **Set Divider:** + * Adjust the `divider` float value. + * `1.0` = Original Size. + * `1.5` = 1.5x smaller (Great for Wan 2.2). + * `2.0` = Half size. +4. **Connect:** + * The node outputs a custom `RESULT` string (for display) and a standard `STRING` (for info). + * *Note:* This node is primarily a calculator. You manually use the numbers shown in "Live Result" to set your Latent size, or you can expand this node to output INT width/height in the future. + +## ๐Ÿ’ก Why "Divider"? + +Unlike "Scale" nodes which usually multiply (upscale), this node **divides** (downscales). + +$$ \text{New Size} = \frac{\text{Original Size}}{\text{Divider}} $$ + +Example: +* Input: `1280 x 720` +* Divider: `1.5` +* Result: `853 x 480` (Perfect 480p safe zone for heavy AI models) + +## ๐Ÿค Contributing + +Feel free to submit issues or pull requests if you have ideas for improvements! + +## ๐Ÿ“„ License + +MIT License. Free to use for everyone.