Add generation quality controls and bind them to the MiniMax workflow.
Expose aspect, CFG, FPS, sampler, and scheduler in Generation settings, persist them on clips and held jobs, and inject those values into the Comfy graph. Keep the image picker stills-only and allow renaming library clips. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,10 @@ export interface GenerateParams {
|
||||
seed: number
|
||||
turbo: boolean
|
||||
length: number
|
||||
cfg: number
|
||||
fps: number
|
||||
samplerName: string
|
||||
scheduler: string
|
||||
filenamePrefix?: string
|
||||
sound?: boolean
|
||||
}
|
||||
@@ -65,6 +69,25 @@ export function buildWorkflow(params: GenerateParams) {
|
||||
node.inputs.length = params.length
|
||||
}
|
||||
|
||||
if (node.class_type === 'CreateVideo' && 'fps' in node.inputs) {
|
||||
node.inputs.fps = params.fps
|
||||
}
|
||||
|
||||
if (node.class_type === 'KSamplerSelect' && 'sampler_name' in node.inputs) {
|
||||
node.inputs.sampler_name = params.samplerName
|
||||
}
|
||||
|
||||
if (node.class_type === 'BasicScheduler' && 'scheduler' in node.inputs) {
|
||||
node.inputs.scheduler = params.scheduler
|
||||
}
|
||||
|
||||
if ('cfg' in node.inputs && typeof node.inputs.cfg === 'number') {
|
||||
node.inputs.cfg = params.cfg
|
||||
}
|
||||
if ('guidance' in node.inputs && typeof node.inputs.guidance === 'number') {
|
||||
node.inputs.guidance = params.cfg
|
||||
}
|
||||
|
||||
if (SEED_CLASSES.has(node.class_type)) {
|
||||
if ('noise_seed' in node.inputs) node.inputs.noise_seed = params.seed
|
||||
if ('seed' in node.inputs) node.inputs.seed = params.seed
|
||||
@@ -91,6 +114,32 @@ export function buildWorkflow(params: GenerateParams) {
|
||||
}
|
||||
}
|
||||
|
||||
if (graph['128']) {
|
||||
graph['128'] = {
|
||||
class_type: 'ImageScale',
|
||||
inputs: {
|
||||
upscale_method: 'nearest-exact',
|
||||
width,
|
||||
height,
|
||||
crop: 'center',
|
||||
image: ['114', 0]
|
||||
},
|
||||
_meta: { title: 'Scaling image' }
|
||||
}
|
||||
}
|
||||
|
||||
graph['105:cfg'] = {
|
||||
class_type: 'FluxGuidance',
|
||||
inputs: {
|
||||
guidance: params.cfg,
|
||||
conditioning: ['105:104', 0]
|
||||
},
|
||||
_meta: { title: 'Guidance scale' }
|
||||
}
|
||||
if (graph['105:16']?.inputs) {
|
||||
graph['105:16'].inputs.conditioning = ['105:cfg', 0]
|
||||
}
|
||||
|
||||
for (const [, node] of entriesOf(graph, 'ComfySwitchNode')) {
|
||||
if (!/step/i.test(titleOf(node))) continue
|
||||
const qualityId = linkId(node.inputs.on_false)
|
||||
@@ -127,6 +176,7 @@ const LABEL_OVERRIDES: Record<string, string> = {
|
||||
'105:10': 'Decoding video frames',
|
||||
'105:14': 'Sampling',
|
||||
'105:16': 'Preparing guider',
|
||||
'105:cfg': 'Applying guidance',
|
||||
'105:17': 'Selecting sampler',
|
||||
'105:23': 'Decoding audio',
|
||||
'105:24': 'Loading audio VAE',
|
||||
|
||||
Reference in New Issue
Block a user