Get MP4 Prompt
Recover the prompt embedded in a rendered video's metadata
- STRING
You know the ComfyUI trick where you drag a generated PNG back into the browser and the whole workflow that made it pops back up, because the graph is embedded right in the image's metadata? This node is that same idea, but for video. If the MP4 was saved with ComfyUI's workflow metadata attached, this node reads the prompt straight back out of the file - no need to remember what you typed, no digging through old queue history.
How it works
Under the hood it uses pymediainfo to read the MP4's General track and pull out the comment field, which is where ComfyUI-style tools stash the embedded workflow as JSON - the same JSON blob that reconstructs your whole graph when you drag a PNG in, just living in a video's metadata track instead of a PNG chunk. The node parses that JSON, walks through every node in the saved graph, and looks for one whose title - the label you set by right-clicking a node and renaming it in the UI, not its class name - matches search_title. Once it finds a match, it pulls that node's text2 input and hands it back as the output string.
That title-matching detail matters: this node isn't reading "the prompt" in any generic sense. It's looking for a specific node you deliberately named, with a specific input field called text2. If nothing in the workflow was titled that way, there's nothing for it to find.
The inputs and outputs that matter
file_path- the path to the.mp4file on disk you want to read.search_title- the exact node title to search for, defaulting to"finalprompt". If you want this to work, you need to have titled a node exactly that (or set this field to match whatever title you actually used) back when you built the workflow that produced the video.
Output: a single STRING - either the recovered prompt text, or literally the string "No prompt found" if nothing matched.
Installing it
Search cspnodes in ComfyUI Manager, or clone it directly:
cd ComfyUI/custom_nodes
git clone https://github.com/cerspense/ComfyUI_cspnodes
Restart afterward. Unlike most of the other nodes in this pack, this one has a real, direct dependency: pymediainfo, listed in the pack's requirements.txt alongside diffusers (which the video-generation nodes elsewhere in the pack need). pymediainfo itself is a thin Python wrapper around the MediaInfo library rather than a pure-Python implementation, so on some systems - particularly a fresh Linux box - the pip install can succeed while the underlying native library is still missing. If this node throws an error on the very first video it touches rather than failing to load at all, that's the more likely culprit; the pack's own import failures (missing diffusers/pymediainfo entirely) show up as the whole cspnodes category vanishing from your node list instead.
Where people get tripped up
Two different things both produce "No prompt found", and it's worth knowing which one you're hitting:
- The video simply has no embedded workflow metadata at all - it wasn't saved by something that writes it into the MP4's comment field in the first place.
- The metadata is there, but no node in that workflow was titled to match
search_title.
The node does distinguish real errors from a clean miss, though - a missing file or a path that isn't a .mp4 raises an explicit error rather than silently returning "no prompt found," so if you're getting that generic message and not a crash, the file itself is fine; it's the title match that's failing.
The other thing to plan for ahead of time: this only works if you set it up before rendering. You can't retrofit this onto old videos that were never generated through a workflow with a properly-titled text2 node - there's no metadata to recover if it was never written.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | — | |
| search_title | STRING | finalprompt | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |