- Fixed types issues - Added: - Int2Tuple node - Deleted due to last ComfyUI update which made them nearly useless now: - ConditioningSetAreaEXT (modded) - EmptyLatentImage (modded) - NOT Deleted, but now might be useless (IMHO): - LatentComposite (modded) - ConditioningSetArea (modded) - TUPLES moved to their own subfolder in UI - ALL custom nodes with FLOAT, INT, STRING values now can use their own fields as inputs (use original conversion to points to connect) - Refactored nearly all code... again
27 lines
645 B
Python
27 lines
645 B
Python
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_UP": field.FLOAT,
|
|
"VALUE_BOT": field.FLOAT,
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("FLOAT",)
|
|
FUNCTION = "get_rand"
|
|
CATEGORY = TREE_FUNCTIONS
|
|
|
|
def get_rand(self, VALUE_UP, VALUE_BOT):
|
|
value = numpy.random.uniform(VALUE_UP, VALUE_BOT)
|
|
return (value,) |