From 626c2062cb13f8e94b513f72863a46469ccddc12 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 4 Feb 2024 01:33:12 -0500 Subject: [PATCH] make prompt path configurable --- workflows/comfy/ComfyLauncher/ComfyRunner.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/workflows/comfy/ComfyLauncher/ComfyRunner.py b/workflows/comfy/ComfyLauncher/ComfyRunner.py index 141d381..c56d93d 100644 --- a/workflows/comfy/ComfyLauncher/ComfyRunner.py +++ b/workflows/comfy/ComfyLauncher/ComfyRunner.py @@ -7,8 +7,22 @@ import signal import aiohttp -current_script_dir = os.path.dirname(os.path.realpath(__file__)) -file_path = os.path.join(current_script_dir, 'prompt', 'prompt.json') +import argparse + +def parse_args(): + parser = argparse.ArgumentParser(description='Run Comfy') + parser.add_argument('--prompt', type=str, help='location of the prompt json', required=True) + return parser.parse_args() + +# current_script_dir = os.path.dirname(os.path.realpath(__file__)) +# file_path = os.path.join(current_script_dir, 'prompt', 'prompt.json') + +args = parse_args() + +file_path = args.prompt + +print(f'Loading prompt json from path: {file_path}') + prompt = json.load(open(file_path)) comfy_path = os.path.dirname(os.path.abspath(__file__))