This node takes in your target dimensions, Unet, and VAE, and outputs a width and height for initial generation using the model you've fed it (or so I hope). For example, asking for a 2048x2048 image would give you 512x512 with a SD 1.5 model. You can generate with that resolution to avoid duplication and other artifacts that plague models when images get too big, then upscale and enhance the resulting latents however you want.
https://github.com/JPPhoto/ideal-size-node
#Ideal Size [3.1+]
26 messages · Page 1 of 1 (latest)
might have missed this - does this have an open PR?
Nice idea. Output of the multiplier to get back to the original resolution might be a good idea. Then that could be used in a resize/upscale node after generating at the best base size.
I put two integer fields in front of the node and use those to get to upscaling.
No PR. Should this be a core node?
hmmm I'm not sure - I could see it being one
@austere minnow do you have thoughts?
for now, maybe we just add it to the community nodes list?
ignore the part that says submit the PR against nodes you'll want to submit against main
So I make my own repo for this, upload it, then modify the communityNodes.md file to link to it and make a PR?
Just want to know what the procedure you envision is.
you nailed it!
We'll see if I nailed it.
Going to get a lot of PRs as people add nodes. 😬
Looks good to me! If you have an example graph to share that might be helpful as well
Agreed on the PRs front, but the other alternative for the time was to merge the actual nodes into the code base which felt messier
Not sure that I want to include an example graph at this point since nodes is very much beta... just... connect it and it works!
Would it be possible to have this maintain aspect ratio of the input width/height?
EDIT: Nevermind, I see this is implemented in the code.
Yep!
It tries its best but is subject to rounding to the nearest 8 pixels. You'll want to eventually do an image or latent resize to the correct target resolution.
I just updated this with a multiplier (float). If you're using a model that doesn't duplicate often or a ControlNet, you may find a larger initial generation size helpful. Setting this to 1.5 would act as if a version 1.5 model has internal dimensions of 768x768, for example.
Updated for 3.1.
Ideal Size (3.1 Compatible)
Ideal Size [3.1+]