An open API service indexing awesome lists of open source software.

https://github.com/if-ai/ComfyUI-WanResolutionSelector

Select the correct resolution to work with videos in WAN
https://github.com/if-ai/ComfyUI-WanResolutionSelector

Last synced: 6 months ago
JSON representation

Select the correct resolution to work with videos in WAN

Awesome Lists containing this project

README

          

# Video Resolution Selector Node for ComfyUI

A ComfyUI custom node that automatically selects appropriate video resolution dimensions based on generation mode, aspect ratio, and quality settings. Designed to work seamlessly with video generation models and KJNodes image resize nodes.

## ๐ŸŽฏ Purpose

This node simplifies the process of selecting the correct resolution for various video generation models by providing an intuitive interface with mode, aspect ratio, and quality dropdowns instead of manually entering width and height values.

## ๐Ÿ“‹ Features

- **Smart Resolution Selection**: Automatically outputs the correct width and height based on your selections
- **Multiple Video Modes**: Support for Image-to-Video (480p/720p) and Text-to-Video (1.3B/14B) models
- **Aspect Ratio Options**: Horizontal (landscape), Vertical (portrait), and Squarish
- **Quality Tiers**: High Quality (HQ), Medium Quality (MQ), and Low Quality (LQ)
- **KJNodes Compatible**: Outputs standard INT values compatible with KJNodes resize nodes

## ๐Ÿš€ Installation

1. Navigate to your ComfyUI custom nodes directory:
```
ComfyUI/custom_nodes/
```

2. Place the `ComfyUI-WanResolutionSelector` folder (this repository) inside your `custom_nodes` directory.

3. Restart ComfyUI.

4. The node will appear in the node menu under the `ImpactFrames๐Ÿ’ฅ๐ŸŽž๏ธ/utils` category.

## ๐Ÿ“Š Supported Resolutions

### Image to Video - 720p (I2V720p)
- **Horizontal**: 1280ร—720 (HQ), 832ร—480 (MQ), 704ร—544 (LQ)
- **Vertical**: 720ร—1280 (HQ), 480ร—832 (MQ), 544ร—704 (LQ)
- **Squarish**: 624ร—624 (all qualities)

### Image to Video - 480p (I2V480p)
- **Horizontal**: 832ร—480 (HQ), 704ร—544 (MQ/LQ)
- **Vertical**: 480ร—832 (HQ), 544ร—704 (MQ/LQ)
- **Squarish**: 624ร—624 (all qualities)

### Text to Video - 14B Model (T2V14B)
- **Horizontal**: 1280ร—720 (HQ), 1088ร—832 (MQ), 832ร—480 (LQ)
- **Vertical**: 720ร—1280 (HQ), 832ร—1088 (MQ), 480ร—832 (LQ)
- **Squarish**: 960ร—960 (HQ), 624ร—624 (MQ), 544ร—704 (LQ)

### Text to Video - 1.3B Model (T2V1.3B)
- **Horizontal**: 832ร—480 (HQ), 704ร—544 (MQ/LQ)
- **Vertical**: 480ร—832 (HQ), 544ร—704 (MQ/LQ)
- **Squarish**: 624ร—624 (all qualities)

## ๐ŸŽฎ Usage

### Basic Workflow

1. **Add the Node**: Right-click in ComfyUI and navigate to `ImpactFrames๐Ÿ’ฅ๐ŸŽž๏ธ/utils` -> `Video Resolution Selector ๐ŸŽฌ`.

2. **Configure Settings**:
- **Mode**: Select your video generation model type
- **Aspect Ratio**: Choose orientation (Horizontal/Vertical/Squarish)
- **Quality**: Pick quality level (HQ/MQ/LQ)

3. **Connect Outputs**:
- Connect `width` output to width input of resize nodes
- Connect `height` output to height input of resize nodes

### Example Workflow

```
[Load Image] โ†’ [Video Resolution Selector] โ†’ [Image Resize KJ] โ†’ [Video Generation Model]
โ†“ โ†“
width height
```

## ๐Ÿ”ง Node Details

### Inputs
| Parameter | Type | Options | Default | Description |
|-----------|------|---------|---------|-------------|
| mode | Dropdown | I2V480p, I2V720p, T2V1.3B, T2V14B | I2V720p | Video generation mode |
| aspect_ratio | Dropdown | Horizontal, Vertical, Squarish | Horizontal | Aspect ratio orientation |
| quality | Dropdown | HQ, MQ, LQ | HQ | Quality level |

### Outputs
| Output | Type | Description |
|--------|------|-------------|
| width | INT | Width in pixels |
| height | INT | Height in pixels |

## ๐Ÿ’ก Tips

- **HQ (High Quality)**: Use for final renders or when quality is paramount
- **MQ (Medium Quality)**: Good balance between quality and generation speed
- **LQ (Low Quality)**: Use for quick previews or testing

- **Aspect Ratio Guide**:
- **Horizontal**: Best for landscape scenes, wide shots
- **Vertical**: Ideal for portrait videos, mobile-first content
- **Squarish**: Good for social media posts, balanced compositions

## ๐Ÿค Compatibility

- Designed to work with KJNodes Image Resize nodes
- Compatible with any node accepting INT inputs for width/height
- Tested with ComfyUI latest versions

## ๐Ÿ› Troubleshooting

If you encounter issues:

1. **Node not appearing**: Ensure the file is in the correct directory and restart ComfyUI
2. **Invalid resolution**: The node includes fallback to 832ร—480 if an invalid combination is selected
3. **Connection issues**: Ensure you're connecting INT outputs to INT inputs

## ๐Ÿ“ License

This node is provided as-is for use with ComfyUI. Feel free to modify and distribute as needed.

## ๐Ÿ™ Credits

Created for seamless integration with video generation workflows in ComfyUI, specifically designed to work with KJNodes ecosystem.