Nodes/comfyui-fvmtools/SMP · Prompt Serialize (legacy)
ComfyUI Node

SMP · Prompt Serialize (legacy)

Turning the PROMPT_DICT into a string CLIP will actually read

By ping1979ping·Created 5 months ago·Updated about a month ago· 0
SMP · Prompt Serialize (legacy)
  • prompt_dict
  • positive_prompt
  • negative_prompt
  • raw_json
formatnatural_language

The SMP pipeline builds your prompt as a dict - subjects, outfits, location, post-processing flags. That structure is great for building and routing, and terrible for generating, because the text encoder wants a string. Prompt Serialize is the seam between the two. It renders the PROMPT_DICT into three STRING outputs and lets you wire whichever one you need into the encoder.

The format input is the one real choice you make here. natural_language (the default) flattens the dict into readable English - "A photograph of a young woman, dark auburn hair, wearing ..., set against ..." - which is exactly what you want feeding a Flux, SDXL, or CLIP encoder. raw_json gives you the pretty-printed dict as text, which is the power-user path for Z-Image / Flux 2 style setups and for eyeballing what the pipeline actually decided.

How it works

The natural-language path assembles from the first subject in subjects (the age/gender anchor, then face prompt, outfit, and pose hint), appends the location sentence, then tacks on quality tags from post_processing.quality_tags. The negative_prompt output is pulled straight from post_processing.negative_prompt - and if your dict never set one, you get a sensible fallback: "blurry, low quality, distorted anatomy, extra limbs, watermark." The raw_json output is the full dict dumped with json.dumps.

The inputs that matter

  • prompt_dict - the merged dict from SMP · Aggregator (or a builder chain).
  • format - natural_language or raw_json.

That's the entire input list. It's a thin node, and that's the point - there's one decision and it's the format.

Outputs

  • positive_prompt → positive CLIPTextEncode.
  • negative_prompt → negative CLIPTextEncode.
  • raw_json → a ShowText node for inspection, or paste it into the Sidecar Saver's extra_metadata_json.

Install

No extra dependencies - this node is pure dict-to-string logic on the base pack:

cd ComfyUI/custom_nodes
git clone https://github.com/ping1979ping/comfyui-FVMtools

Restart ComfyUI.

Common issues

If your positive prompt reads like a robot wrote it, you're probably on raw_json by mistake - switch the format back. If the negative output is always the generic fallback, your dict's post_processing block never set a real negative_prompt; some builder paths just don't carry one. And if the positive prompt seems to be missing the location or outfit, check upstream that those builders actually merged into the prompt_dict before you serialize.

CategoryFVM Tools/SMP/Output

Inputs (2)

NameTypeDefaultDescription
prompt_dictPROMPT_DICT
formatCOMBOnatural_language2 options: natural_language, raw_json

Outputs (3)

NameTypeDescription
positive_promptSTRING
negative_promptSTRING
raw_jsonSTRING