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
I have this equation/code that I think should ensure that, for given value X, the number provided will make the returned value either zero (if X would create a negative number when 224 is subtracted) allow the number to pass through unchanged if not, and would ensure that the number could not exceed the value of X minus 224.
My purpose is to ensure that a 224px square box can always fit within the confines of a larger box.
However, when I run this code in my context (a Stable Diffusion/ComfyUI node called "Evaluate Floats" that uses your library) I get the following error:
Error occurred when executing Evaluate Floats:
Function 'max' not defined, for expression 'max(0, min(a, a - 224)) if a >= 224 else a'.
. Is my syntax simply wrongly formatted for your library?
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
-
max(0, min(X, X - 224)) if X >= 224 else X
I have this equation/code that I think should ensure that, for given value X, the number provided will make the returned value either zero (if X would create a negative number when 224 is subtracted) allow the number to pass through unchanged if not, and would ensure that the number could not exceed the value of X minus 224.
My purpose is to ensure that a 224px square box can always fit within the confines of a larger box.
However, when I run this code in my context (a Stable Diffusion/ComfyUI node called "Evaluate Floats" that uses your library) I get the following error:
. Is my syntax simply wrongly formatted for your library?
Beta Was this translation helpful? Give feedback.
All reactions