Nodes/ComfyUI-Reverse-prompt-node/Reverse Prompt Loader (JSON)
ComfyUI Node

Reverse Prompt Loader (JSON)

“Reverse Prompt Loader (JSON)” is just a fancy text loader — and that’s fine

By navyxiong·Created 7 months ago·Updated 6 months ago· 1
Reverse Prompt Loader (JSON)
    • json_string
    preset_file
    stringify_modePretty (Indented)

    The name promises something big - a node that "reverses" a prompt, maybe even calls some AI API. It does none of that. Reverse Prompt Loader (JSON) is a preset-file loader: it reads a .json file out of a folder and hands it to you as a string. No network, no model, no key. If you got here because you saw the name, you were expecting the wrong thing, and once you know what it actually is it's a perfectly decent little utility.

    What it's actually for

    It ships in a pack built around a specific workflow from the Chinese architecture-visualization scene (the pack's category is literally ChiefAI/Utils). The idea: drop a reference image of a building into a vision-language model like Qwen3-VL-4B, and have it "reverse-engineer" the design into a structured JSON - style, facade composition, materials, color palette, the works. That JSON then becomes the prompt for regenerating a similar building on a different massing. The wider genre - an LLM writing a structured prompt from an image, instead of you hand-writing one - is exactly the "LLM-assisted prompting" direction the community has converged on.

    This node is the small cog that serves the instruction side of that job. The plugin ships with 10 preset JSONs: five architectural domains - facade, bird's-eye/aerial view, perspective render, landscape, interior - each in Chinese and English. Pick one and you've got a structured system prompt like role, goal, output_rules, example_structure, ready to feed the VLM before it looks at your image.

    How it works

    Nothing magic here, and the source is reassuringly small. On load, the node scans its own presets/ folder, lists every .json file, and turns that sorted list into your dropdown. It validates the file with json.load, then re-serializes it with json.dumps. Two things worth knowing:

    • It uses ensure_ascii=False, so the Chinese-language presets stay as readable Chinese instead of a wall of \uXXXX escapes.
    • It implements IS_CHANGED by returning the file's modification time. That means if you edit a preset in a text editor and re-run, the node actually picks up the change - a real gotcha in many loader nodes that cache forever.

    No requirements.txt, no pip installs, no huggingface download. The only imports are os, json, and hashlib. This is pure standard library.

    Inputs and output

    Just two inputs, and you'll set both:

    • preset_file - a dropdown auto-populated from whatever JSONs are in presets/. This is the whole point of the node.
    • stringify_mode - Pretty (Indented) or Minified (One Line). Pretty is for humans reading the workflow; Minified saves tokens if you're blasting this into a VLM context window.

    The single output, json_string (STRING), wires straight into the text/prompt input of whatever Qwen3-VL node you're driving. In the pack's bundled workflow that's the Qwen3_VQA node from the QwenVL custom-node family.

    Installing it

    Either via ComfyUI Manager (search "ComfyUI-Reverse-prompt-node"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/navyxiong/ComfyUI-Reverse-prompt-node
    

    Then restart ComfyUI. Heads-up: the README's clone command contains a placeholder yourusername URL - ignore that, use the repo above.

    The README also tells you to download Qwen3-VL-4B-Instruct (from ModelScope) into ComfyUI/models/prompt_generator. That's for the workflow, not this node - the loader works with nothing installed. But if you want the reverse-prompt workflow to actually do anything, you'll need that model plus a QwenVL node pack, and those are the heavy dependencies (a few GB of weights, VRAM for a 4B multimodal model).

    Where people get burned

    • "No_json_files_found" appears in the dropdown when the presets/ folder is empty or missing. The node creates the folder itself and returns a JSON error string instead of crashing - which is a nicer failure mode than most nodes give you.
    • A corrupt preset (invalid JSON) returns an error_loading_file string and a console message rather than killing the run. Fix the file, re-run.
    • New presets don't appear instantly. The dropdown is built when the node's inputs are generated, so after you drop a new file in, refresh the graph before hunting for it.

    It's a niche loader for a niche workflow. But if you're running Qwen3-VL-based reverse prompting on architecture references, it keeps your system prompts out of your workflow graph and versionable as plain files - which is a small win that compounds.

    CategoryChiefAI/Utils

    Inputs (2)

    NameTypeDefaultDescription
    preset_fileCOMBO10 options: 01建筑立面反推提示词(中文).json, 01建筑立面反推提示词(英文).json, 02鸟瞰效果图反推提示词(中文).json, 02鸟瞰效果图反推提示词(英文).json, 03透视效果图反推提示词(中文).json, 03透视效果图反推提示词(英文).json, +4
    stringify_modeCOMBOPretty (Indented)2 options: Pretty (Indented), Minified (One Line)

    Outputs (1)

    NameTypeDescription
    json_stringSTRING