Add sidecar Qwen VL prompt recommend, fix queued shot bursts, and leave unused MiniMax identity slots empty.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import template from '../assets/workflow_vision_prompt.json'
|
||||
|
||||
type WorkflowNode = { class_type: string; inputs: Record<string, unknown>; _meta?: { title?: string } }
|
||||
type WorkflowGraph = Record<string, WorkflowNode>
|
||||
|
||||
const IMAGE_NODE = '1'
|
||||
const TEXT_NODE = '3'
|
||||
|
||||
export function buildVisionPromptWorkflow(params: {
|
||||
imageName: string
|
||||
draftPrompt: string
|
||||
systemPrompt: string
|
||||
seed?: number
|
||||
}) {
|
||||
const graph = structuredClone(template) as WorkflowGraph
|
||||
if (graph[IMAGE_NODE]) graph[IMAGE_NODE].inputs.image = params.imageName
|
||||
if (graph[TEXT_NODE]) {
|
||||
graph[TEXT_NODE].inputs.system_prompt = params.systemPrompt
|
||||
graph[TEXT_NODE].inputs.prompt = params.draftPrompt
|
||||
graph[TEXT_NODE].inputs.seed = Number.isFinite(params.seed) ? Number(params.seed) : Math.floor(Math.random() * 2_147_483_647)
|
||||
}
|
||||
return graph
|
||||
}
|
||||
Reference in New Issue
Block a user