Files
Isulion-ComfyUI_Isulion/ComfyUI_Isulion/utils/common.py
T
2024-11-01 02:42:30 +01:00

14 lines
411 B
Python

import random
def handle_seed(seed):
"""Common seed handling logic used across nodes"""
if seed is not None and seed > 0:
random.seed(seed)
else:
seed = random.randint(0, 0xffffffffffffffff)
random.seed(seed)
return seed
def flatten_dict_values(d):
"""Flattens dictionary values into a single list"""
return [item for sublist in d.values() for item in sublist]