Join pre/prompt/post into the first MiniMax prompt, not only later shots.
The motion prompt field is what Comfy actually runs. Wrappers are now composed into that string on submit, and shot 1 falls back to it if the separate pre/post fields do not arrive. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import { imageDimensions } from '~/server/utils/resolution'
|
||||
import { emitChainJob } from '~/server/utils/watch'
|
||||
import { saveStill, stillChainName } from '~/server/utils/library'
|
||||
import { comfyJobPrefix } from '~/utils/outputNames'
|
||||
import { joinPromptParts } from '~/utils/promptParts'
|
||||
import { restorePromptParts, wrappedPromptForComfy } from '~/utils/promptParts'
|
||||
|
||||
export type EditImageFile = { filename: string; data: Buffer; type?: string }
|
||||
|
||||
@@ -32,7 +32,14 @@ export type EditRunParams = {
|
||||
export async function runEdit(job: Job, params: EditRunParams) {
|
||||
const library = job.library
|
||||
if (!library) throw new Error('Edit job is missing library metadata')
|
||||
const prompts = [params.prompt, ...params.passes.map(item => item.prompt)]
|
||||
const prompts = [
|
||||
library.promptMid || restorePromptParts(params.prompt, {
|
||||
pre: library.promptPre,
|
||||
prompt: params.prompt,
|
||||
post: library.promptPost
|
||||
}).prompt,
|
||||
...params.passes.map(item => item.prompt)
|
||||
]
|
||||
const chainTotal = prompts.length
|
||||
const batch = params.passMode !== 'chain'
|
||||
const unit = batch ? 'Batch' : 'Pass'
|
||||
@@ -68,7 +75,7 @@ export async function runEdit(job: Job, params: EditRunParams) {
|
||||
if (job.status === 'cancelled') throw new Error('Job interrupted.')
|
||||
if (index > 0 && library.stopAfterCurrent === true) break
|
||||
const mid = (batch || index === 0) ? composeFillPrompt(prompts[index], filled.padded) : prompts[index]
|
||||
const prompt = joinPromptParts(library.promptPre, mid, library.promptPost)
|
||||
const prompt = wrappedPromptForComfy(library, mid, index === 0 ? params.prompt : mid)
|
||||
const last = index === prompts.length - 1
|
||||
if (index > 0) {
|
||||
await ensureComfyReady((status) => {
|
||||
|
||||
Reference in New Issue
Block a user