Nodes/ComfyUi-MpiNodes/Mpi RandPromptGen Save
ComfyUI Node

Mpi RandPromptGen Save

Freeze your random prompt generator into a reusable preset

By MadPonyInteractive·Created 11 months ago·Updated 5 days ago· 3
Mpi RandPromptGen Save
  • preset
  • destination
preset_namemy_new_preset
destination_folderpath/to/save/preset_folder

The Mpi prompt randomizer works from a preset: a folder of .txt files, one list of options per section (shot type, hair, clothes, pose, location, lighting), plus a settings.json that records section order and transitions. Every run you tweak that generator - override a list here, reorder sections there - and the changes live in memory. MpiRandPromptGenSave is the "make this permanent" button: it takes the live MPI_PROMPT_PRESET off the wire and writes it out as a named folder you can point MpiRandPromptGen's preset_folder at later, or share with someone else's install.

It's one of those nodes that only makes sense once you've hit the wall it solves. The randomizer is great for batch variations, but if you spent an hour tuning the perfect option lists and didn't save, that work evaporates when the graph closes. This node turns your configuration into a file, which is the only durable currency ComfyUI has.

How it works

A preset is plain text on disk. The save node copies the source preset's folder into <destination_folder>/<preset_name>, then replays your live overrides: any list you modified through the OverrideList node gets written back to its .txt file in the new folder, settings.json is rewritten with your current section order and transitions, and the boilerplate read_me.txt is dropped so the saved preset is clean. What you get is a folder that MpiRandPromptGen will happily load next time - same structure, your changes baked in.

The inputs that matter

Only three, and they're all simple:

  • preset - the MPI_PROMPT_PRESET wire, straight out of MpiRandPromptGen or one of its override siblings. This is the thing being saved.
  • preset_name - the folder name. Defaults to my_new_preset, which you will absolutely forget to change at least once.
  • destination_folder - where the preset folder lands. The default path/to/save/preset_folder is a placeholder; set a real path.

It outputs destination, a STRING with the full path it wrote to - handy if you want to log it or feed it somewhere. It's an output node, so it always runs when its inputs arrive.

Install

It ships with the whole ComfyUi-MpiNodes pack, so installing that gets it: in ComfyUI Manager search "MpiNodes" (or the publisher "mad-pony-interactive"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/MadPonyInteractive/ComfyUi-MpiNodes

then restart ComfyUI. No extra model files or Python dependencies for this node - it's pure file copying.

Where people trip

The destination folder defaults are placeholders, and a preset named my_new_preset buried in path/to/save is a mistake you'll discover a week later. Also note the copy logic: if <destination_folder>/<preset_name> already exists, it does not re-copy the source - it only updates the overridden lists and settings.json on top of whatever's there. If you want a truly fresh copy, delete the target folder first. And because the saved output is a folder, not a single file, sharing a preset means zipping that folder - there's no one-file export here.

CategoryMpiNodes/PromptGen

Inputs (3)

NameTypeDefaultDescription
presetMPI_PROMPT_PRESET
preset_nameSTRINGmy_new_preset
destination_folderSTRINGpath/to/save/preset_folder

Outputs (1)

NameTypeDescription
destinationSTRING