File size: 637 Bytes
e0e88f3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import numpy.random
import custom_nodes.Derfuu_ComfyUI_ModdedNodes.components.fields as field
from custom_nodes.Derfuu_ComfyUI_ModdedNodes.components.tree import TREE_FUNCTIONS
class RandomValue:
def __init__(self):
pass
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"Value_A": field.FLOAT,
"Value_B": field.FLOAT,
}
}
RETURN_TYPES = ("FLOAT",)
FUNCTION = "get_rand"
CATEGORY = TREE_FUNCTIONS
def get_rand(self, Value_A, Value_B):
value = numpy.random.uniform(Value_A, Value_B)
return (value,) |