Nodes/comfyui-outfit/🧩 Preset Patch Applier
ComfyUI Node

🧩 Preset Patch Applier

The Glue Node for the Outfit Helper Chain

By manifestations·Created about a year ago·Updated 12 months ago· 3
🧩 Preset Patch Applier
    • merged_json
    preset_patch_json{}
    existing_json{}

    This is the least glamorous node in the comfyui-outfit pack, and also the one that makes the helper system work. Preset Patch Applier (class PresetPatchApplierNode, in 👗 Outfit/Helpers) merges two JSON objects and hands you one. That's it. No models, no randomness, no opinion - it's the plumbing between the pack's "smart" helpers and its "consumers."

    Why it exists

    The pack's Photo Style Helper doesn't talk to the outfit nodes directly. It emits a preset_patch_json - a JSON object describing only the fields it wants to influence (mood, background, color scheme, description style, and so on). Meanwhile you might already have a JSON blob representing your existing setup. Something has to combine those into one object the Inputs-From-JSON nodes can decode, and that something is this node:

    Photo Style Helper ──preset_patch_json──> Preset Patch Applier ──merged_json──> Male/Female Outfit Inputs From JSON ──> Outfit Node
    

    You can also use it standalone as a general-purpose "merge two JSON strings" utility in your graph - it's a perfectly good little merge node for any downstream consumer that accepts JSON.

    Inputs and behavior

    Two required STRING inputs, both multiline:

    • preset_patch_json - the patch; values here override the base.
    • existing_json - the base mapping you're patching on top of.

    Output: merged_json, a JSON string of the combined object. The merge is shallow (one level deep) and the patch wins, with one friendly quirk: if a patch value is an empty string, it's skipped rather than clobbering the base value with nothing. Handy when a helper emits a field it didn't actually set. Invalid JSON on either side is treated as {} rather than raising - the node would rather merge nothing than crash your queue.

    Install and caveats

    Pack-standard install: ComfyUI Manager (search "ComfyUI Outfit Selection") or git clone https://github.com/manifestations/comfyui-outfit.git into ComfyUI/custom_nodes/, restart. No dependencies beyond Python's stdlib json.

    The caveats are the merge semantics. It's shallow - nested objects aren't deep-merged; a nested key in the patch replaces the whole nested object in the base. And there's no key validation: it'll happily merge keys the outfit nodes don't understand, which downstream just ignore (the outfit node logs an "unknown keys" warning if you feed them via a preset). For a beginner the takeaway is simpler: if your photo style choices aren't showing up in the final prompt, check that this node actually sits in the wire path between Photo Style Helper and your Inputs-From-JSON node - it's the one link people draw wrong.

    Category👗 Outfit/Helpers

    Inputs (2)

    NameTypeDefaultDescription
    preset_patch_jsonSTRING{}
    existing_jsonSTRING{}

    Outputs (1)

    NameTypeDescription
    merged_jsonSTRING