A simple script (also a Custom Node in ComfyUI), to calculate and automatically set the recommended initial latent size for Stable Diffusion 1.5 image generation and its Upscale Factor based on the desired Final Resolution output.
Example Workflow of usage in ComfyUI : JSON / PNG
To install it as ComfyUI custom node using manual Git Clone Operation :
- Go to this folder /ComfyUI/custom_nodes/
- Open command prompt to that folder, type this line below:
- git clone https://github.com/marhensa/sd15-recommended-res-calc.git
- Restart ComfyUI, now this custom node "Recommended Resolution Calculator SD15" is located in "utils" node section
- Usage: DesiredXSIZE and DesiredYSIZE is your TARGET FINAL RESOLUTION, Upscale Factor OR Reverse Upscale Factor is used as example above
As standalone (Not Using ComfyUI):
- Download (Click green button Code > Download ZIP) from repo. Or this direct link.
- Make sure .Py and .Bat file on same folder
- Double click .Bat file! (.Sh for Linux)
- Input your desired Final Resolution
- You'll get recommended SD 1.5 Initial Image Size, and its upscale factor to reach the Final Resolution.