fix: log when random seed is applied

This commit is contained in:
bennykok 2024-08-10 10:35:48 -07:00
parent 98cd5ef79c
commit f6ea252652

View File

@ -221,18 +221,23 @@ def apply_random_seed_to_workflow(workflow_api):
if isinstance(workflow_api[key]['inputs']['seed'], list): if isinstance(workflow_api[key]['inputs']['seed'], list):
continue continue
if workflow_api[key]['class_type'] == "PromptExpansion": if workflow_api[key]['class_type'] == "PromptExpansion":
workflow_api[key]['inputs']['seed'] = randomSeed(8); workflow_api[key]['inputs']['seed'] = randomSeed(8)
logger.info(f"Applied random seed {workflow_api[key]['inputs']['seed']} to PromptExpansion")
continue continue
if workflow_api[key]['class_type'] == "RandomNoise": if workflow_api[key]['class_type'] == "RandomNoise":
workflow_api[key]['inputs']['noise_seed'] = randomSeed(); workflow_api[key]['inputs']['noise_seed'] = randomSeed()
logger.info(f"Applied random noise_seed {workflow_api[key]['inputs']['noise_seed']} to RandomNoise")
continue continue
if workflow_api[key]['class_type'] == "KSamplerAdvanced": if workflow_api[key]['class_type'] == "KSamplerAdvanced":
workflow_api[key]['inputs']['noise_seed'] = randomSeed(); workflow_api[key]['inputs']['noise_seed'] = randomSeed()
logger.info(f"Applied random noise_seed {workflow_api[key]['inputs']['noise_seed']} to KSamplerAdvanced")
continue continue
if workflow_api[key]['class_type'] == "SamplerCustom": if workflow_api[key]['class_type'] == "SamplerCustom":
workflow_api[key]['inputs']['noise_seed'] = randomSeed(); workflow_api[key]['inputs']['noise_seed'] = randomSeed()
logger.info(f"Applied random noise_seed {workflow_api[key]['inputs']['noise_seed']} to SamplerCustom")
continue continue
workflow_api[key]['inputs']['seed'] = randomSeed(); workflow_api[key]['inputs']['seed'] = randomSeed()
logger.info(f"Applied random seed {workflow_api[key]['inputs']['seed']} to {workflow_api[key]['class_type']}")
def apply_inputs_to_workflow(workflow_api: Any, inputs: Any, sid: str = None): def apply_inputs_to_workflow(workflow_api: Any, inputs: Any, sid: str = None):
# Loop through each of the inputs and replace them # Loop through each of the inputs and replace them