2.8 KiB
2.8 KiB
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.
🚀 Key Features
- Smart Parsing: Accepts various format inputs like
1920 x 1080,1920x1080,1920 1080, or1920, 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
- Navigate to your ComfyUI
custom_nodesdirectory. - Open a terminal/command prompt.
- Run the following command:
git clone https://github.com/CraftBlack/ComfyUI-Resolution-Divider.git - Restart ComfyUI.
Method 2: ComfyUI Manager
Coming soon... (Once registered in the index)
🛠️ Usage
- Add the Node:
- Right-click canvas ->
Add Node->Resolution Utils->Resolution Divider (VRAM Saver).
- Right-click canvas ->
- 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.
- Option A: Type the resolution manually in
- Set Divider:
- Adjust the
dividerfloat value. 1.0= Original Size.1.5= 1.5x smaller (Great for Wan 2.2).2.0= Half size.
- Adjust the
- Connect:
- The node outputs a custom
RESULTstring (for display) and a standardSTRING(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.
- The node outputs a custom
💡 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.
