Sign In

New ComfyUI Node - Better Image Dimensions

1

New ComfyUI Node - Better Image Dimensions

Problem: I wanted to be able to switch my image dimensions on the fly, swapping from landscape to portrait with ease. In ComfyUI, I had to reassign the connections, which is a bit too cumbersome. Additionally, I didn't know what ratios and image dimensions worked for SDXL vs SD 1.5, so I had to look online and keep a separate tab for reference when changing dimensions.

Solution: This node pack includes 3 nodes to help solve the problems listed above.

First is the Better Image Dimensions node that allows you to set your own width and height while giving you access to the common image ratios that will automatically adjust either your width or height (user choice as "enforce_dimension") to stay within your desired ratio. You can also choose to not use a ratio. Furthermore, you can easily swap between landscape and portrait mode by choosing the order of output, defaulting to width x height. Choosing the swap option will swap the two values to height x width so you don't have to reconnect your nodes over again.

Second is the Standard SDXL Dimensions node. You no longer have to look up what dimensions work best with SDXL, this node comes pre-loaded with the right dimensions for you! It also features the ability to switch between landscape and portrait mode by swapping the order of the outputs.

Third is the Dimensions by Ratio node. If you're not concerned about the actual pixel values but instead want to fit into a specific ratio, this is for you. You can choose a ratio then scale the image up or down using the "adjust_scale" value. Because SDXL is base 1024 and SD 1.5 is base 512, there's an option to choose which model you're using so the ratio creates width and height values at the appropriate base. This node again supports the ability to swap your width and height.

You can find the repository here, I hope this is a nice QoL improvement for those in ComfyUI.

1