marhensa / sd15-recommended-res-calc

A simple script to calculate the recommended initial latent size for SD 1.5 image generation and its Upscale Factor based on the desired Final Resolution output

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sd15-recommended-res-calc

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.

Usage showcase in ComfyUI image

Example Workflow of usage in ComfyUI : JSON / PNG

To install it as ComfyUI custom node using manual Git Clone Operation :

  1. Go to this folder /ComfyUI/custom_nodes/
  2. Open command prompt to that folder, type this line below:
  3. git clone https://github.com/marhensa/sd15-recommended-res-calc.git
  4. Restart ComfyUI, now this custom node "Recommended Resolution Calculator SD15" is located in "utils" node section
  5. 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):

  1. Download (Click green button Code > Download ZIP) from repo. Or this direct link.
  2. Make sure .Py and .Bat file on same folder
  3. Double click .Bat file! (.Sh for Linux)
  4. Input your desired Final Resolution
  5. You'll get recommended SD 1.5 Initial Image Size, and its upscale factor to reach the Final Resolution.

About

A simple script to calculate the recommended initial latent size for SD 1.5 image generation and its Upscale Factor based on the desired Final Resolution output


Languages

Language:Python 99.2%Language:Shell 0.4%Language:Batchfile 0.4%