From 69be32b6722411d94f9d6374eb415d6474da5694 Mon Sep 17 00:00:00 2001 From: Steve Tietze Date: Fri, 9 Jan 2026 17:01:33 +0700 Subject: [PATCH] fixing parsing node -- hold tight --- nodes.py | 6 ++++-- web/docs/kie_prompt_grid.md | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/nodes.py b/nodes.py index 8f04b4a..ccc778e 100644 --- a/nodes.py +++ b/nodes.py @@ -545,7 +545,7 @@ KIE Parse Prompt Grid JSON (1..9) Parse LLM JSON containing up to 9 prompts and return each prompt as a separate string output. Inputs: -- json_text: Raw JSON from an LLM (list or object) +- json_text: Raw JSON from an LLM (list or object), wired STRING input - default_prompt: Fallback prompt if parsing yields no prompts - max_items: Cap the number of prompts (1..9) - strict: Raise errors when parsing fails or yields no prompts @@ -560,7 +560,7 @@ Outputs: def INPUT_TYPES(cls): return { "required": { - "json_text": ("STRING", {"multiline": True, "default": ""}), + "json_text": ("STRING", {"forceInput": True}), }, "optional": { "default_prompt": ("STRING", {"default": ""}), @@ -608,6 +608,8 @@ Outputs: debug: bool = False, ): fallback = (default_prompt or "").strip() + if not (json_text or "").strip() and fallback: + json_text = fallback try: prompts = parse_prompts_json(json_text, max_items=max_items, strict=strict, debug=debug) diff --git a/web/docs/kie_prompt_grid.md b/web/docs/kie_prompt_grid.md index 6be200e..c8559d2 100644 --- a/web/docs/kie_prompt_grid.md +++ b/web/docs/kie_prompt_grid.md @@ -2,6 +2,8 @@ Parse LLM JSON containing up to 9 prompts and expose each prompt as a separate string output. +This node requires a wired STRING input for `json_text`. It does not provide a manual JSON textbox. + --- ## Example JSON inputs @@ -46,7 +48,7 @@ Object format (underscore keys): ## Outputs -- **p1..p9** +- **prompt 1..prompt 9** Each prompt as a separate STRING output. Missing entries are empty strings. - **count** @@ -59,8 +61,8 @@ Object format (underscore keys): ## Grid wiring tips -- **2x2 grid**: Use p1..p4. -- **3x3 grid**: Use p1..p9. +- **2x2 grid**: Use prompt 1..prompt 4. +- **3x3 grid**: Use prompt 1..prompt 9. Feed each prompt into the corresponding downstream node inputs.