Amorano / Jovimetrix

ComfyUI node suite for composition, stream webcams or media files in and out, animation, flow control, making masks, shapes and textures like Houdini and Substance Designer, read MIDI devices. Also has colorization options for workflow nodes via regex, groups and each node.
Other
275 stars 22 forks source link

xy random value #64

Open metamountain opened 21 hours ago

metamountain commented 21 hours ago

Could you tell me how to put in random values fo x and y (min max)? I dont know how to do it, because x y is one value....

image

metamountain commented 21 hours ago

Often work with batch load , so that would be handy...

Amorano commented 2 hours ago

you could use a "VALUE" node which will output a VEC2, or, you can build a VEC2 from something else, with random "inputs":

image

The vectors run (x, y, z, w) [the columns] The MIN is the row on top for each The MAX is the row on bottom for each

HOWEVER

Jovimetrix uses normalized coordinates (-1...1) so there is no way you will be able to use a random from -20 to 512 as an offset. You would need to calculate the normalized version of that first i.e. :

minimum: (-20 / 512) == -0.0390625 maximum: 1.0

so that would look like:

image

To give the random ranges of:

X == -0.0390625 -> 1.0 (-20 to 512 if your image is 512 wide) Y == -0.0390625 -> 1.0 (-20 to 512 if your image is 512 high)

image

Let me know if those are not the results you get.