Send V2 identity prompts to Reference to Video instead of Image to Video.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -163,12 +163,14 @@ export function extractPromptFromHistory(entry: unknown) {
|
||||
const prompt = (entry as { prompt?: unknown[] })?.prompt
|
||||
const graph = Array.isArray(prompt) ? prompt[2] : null
|
||||
if (!graph || typeof graph !== 'object') return ''
|
||||
let imageToVideo = ''
|
||||
for (const node of Object.values(graph as Record<string, { class_type?: string; inputs?: Record<string, unknown> }>)) {
|
||||
if (node?.class_type === 'MiniMaxH3ImageToVideo') {
|
||||
return String(node.inputs?.prompt || node.inputs?.text || '').trim()
|
||||
}
|
||||
const text = String(node.inputs?.prompt || node.inputs?.text || '').trim()
|
||||
if (!text) continue
|
||||
if (node?.class_type === 'MiniMaxH3ReferenceToVideo') return text
|
||||
if (node?.class_type === 'MiniMaxH3ImageToVideo') imageToVideo = text
|
||||
}
|
||||
return ''
|
||||
return imageToVideo
|
||||
}
|
||||
|
||||
export function extractClipMetaFromHistory(entry: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user