State Manager
A character & prompt library that lives on disk, not in your workflow JSON
- dora_state
- positive_prompt_template
- negative_prompt_template
- settings_json
- selected_lora_stack
- state_settings
- seed
- state_control
- character_image
- fileimage_prefix
The State Manager is the pack's front-end for reusable characters and prompt presets, and its whole bet is that your workflow JSON shouldn't be where your prompts and LoRA stacks live. You build a character once - a face LoRA here, an outfit stack there, the positive/negative prompt templates, a seed, even a reference thumbnail - and from then on the workflow only stores a small UUID binding. Selecting a character tile or prompt preset just changes the selection; the actual data stays in a persistent per-user library on disk:
<ComfyUI user directory>/<active user id>/dora_state_manager/state-library.json
It's the same idea as a primitive value node (one source, many consumers, from the plumbing playbook), scaled up to whole character bundles - and it keeps the graph readable instead of one giant prompt blob per character.
How it works
The UI opens library-first: an All presets grid showing prompt presets from every character, a Characters pane for the LoRA-state library, and search that matches character names, preset names, filename prefixes, and saved LoRA filenames. Four graph-editing actions do the real work: Save connected, Load connected, Save selected, and Apply selected. Saving captures state from nodes downstream of state_control; loading pushes the selected character/preset back into them. Nothing mutates other nodes until you click load or apply.
On the storage side it's careful: writes use a lock, optimistic revisions, and atomic os.replace(), malformed files get quarantined as state-library.json.corrupt-<timestamp> instead of overwritten, and a stale write from another browser tab is rejected (hit Reload library to resync). Export/import give you portability: character exports for one character, library exports for the whole thing.
Wiring it up
The README's recommended shape is worth copying exactly:
- Add the State Manager.
- Add State Text Box nodes for editable positive and negative prompt templates.
- Add State Seed for an editable seed value.
- Add one or more DoRA Power LoRA Loader nodes, each with a unique State slot -
face,outfit,style,refiner. - Connect
state_controlfrom the manager to each node'sstate_controlinput. - Connect
textfrom each text box into the prompt/wildcard path; connectseedfrom State Seed only to the sampler seed input.
State Manager.state_control → State Text Box.state_control
State Text Box.text → Wildcards Processor → CLIP Text Encode
With several DoRA loaders, each loader's State slot matches one saved loader_stacks entry, so Save connected captures all stacks separately and Load connected pushes each back to the right loader. The required inputs (state_json, ui_state_json, selected_character_id, selected_prompt_id) are hidden binding widgets - the frontend fills them.
The trap to avoid
Don't wire wildcard-processed or other runtime text back into the manager. It has no runtime capture inputs - that feedback shape isn't part of the design. Store the raw template in the text box and let your wildcard node expand it downstream. And if a selected preset reports "unavailable," it means the UUID isn't on this machine; it won't silently substitute another character.
Install
Search ComfyUI-DoRA-Dynamic-LoRA-Loader in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/xmarre/ComfyUI-DoRA-Dynamic-LoRA-Loader
Restart and you're done - no model downloads, no pip dependencies. If you have a workflow that still uses the old DoRA State Manager alias, that node is the same engine under its legacy name.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| state_json | STRING | {"version":1,"kind":"dora_state_manager_binding"} | — |
| ui_state_json | STRING | {"version":2} | — |
| selected_character_id | STRING | default_character | — |
| selected_prompt_id | STRING | default_prompt | — |
Outputs (10)
| Name | Type | Description |
|---|---|---|
| dora_state | DORA_STATE | — |
| positive_prompt_template | STRING | — |
| negative_prompt_template | STRING | — |
| settings_json | STRING | — |
| selected_lora_stack | DORA_LORA_STACK | — |
| state_settings | DORA_STATE_SETTINGS | — |
| seed | INT | — |
| state_control | STATE_MANAGER_CONTROL | — |
| character_image | IMAGE | — |
| fileimage_prefix | STRING | — |