You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
I am making a node setup that needs to make an image divisible by 16 on each side before passing to P2LDGAN to create line art.
I tried to use the Math Expression node to try to do "round(a / 16) * 16" for the X and Y, after first resizing the image to 1024 on the X side. In this way, I hope to deliver to P2LDGAN a number divisible by 16 (it requires this), and to use this integer for the latent image size as well. But I can't use Round yet in that node.
I realize that the rounding happens when it is turned from a float to an Int, but that doesn't work for this situation. f/e, the image shown here, of a Chun li I drew and want to restyle, reduces (without an initial round) to 680x1024, which means the 680 divides by 16 to 42.5. If I had a rounding node, I could cobble something together with the bits of other folks that have made simple math nodes, including WAS...but so far I have not been able to find a way to round a result :(.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I am making a node setup that needs to make an image divisible by 16 on each side before passing to P2LDGAN to create line art.
I tried to use the Math Expression node to try to do "round(a / 16) * 16" for the X and Y, after first resizing the image to 1024 on the X side. In this way, I hope to deliver to P2LDGAN a number divisible by 16 (it requires this), and to use this integer for the latent image size as well. But I can't use Round yet in that node.
I realize that the rounding happens when it is turned from a float to an Int, but that doesn't work for this situation. f/e, the image shown here, of a Chun li I drew and want to restyle, reduces (without an initial round) to 680x1024, which means the 680 divides by 16 to 42.5. If I had a rounding node, I could cobble something together with the bits of other folks that have made simple math nodes, including WAS...but so far I have not been able to find a way to round a result :(.
My nodes look like so:
Anyone have an idea how I might do this?
Beta Was this translation helpful? Give feedback.
All reactions