Restore automatic output size that matches the input still.

Keep 16:9, 9:16, and square as overrides, but default aspect back to Auto so MiniMax follows the source image.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-25 23:09:11 -05:00
co-authored by Cursor
parent e81f12f89a
commit a47e714212
3 changed files with 51 additions and 18 deletions
+2 -2
View File
@@ -111,7 +111,7 @@ export default defineEventHandler(async (event) => {
folderLocked,
name: clipName,
prompt,
aspect: fields.aspect || '16:9',
aspect: fields.aspect || 'auto',
width,
height,
steps,
@@ -177,7 +177,7 @@ export default defineEventHandler(async (event) => {
seed,
width,
height,
aspect: fields.aspect || '16:9',
aspect: fields.aspect || 'auto',
cfg,
fps,
sampler_name: samplerName,
+5 -1
View File
@@ -85,10 +85,14 @@ function jpegSize(buf: Buffer) {
return null
}
export function resolveOutputSize(aspect: string | undefined, _image: Buffer, fallbackWidth?: number, fallbackHeight?: number) {
export function resolveOutputSize(aspect: string | undefined, image: Buffer, fallbackWidth?: number, fallbackHeight?: number) {
if (aspect && ASPECT_PRESETS[aspect]) {
return ASPECT_PRESETS[aspect]
}
const size = imageDimensions(image)
if (size?.width && size?.height) {
return autoResolution(size.width, size.height)
}
if (Number(fallbackWidth) && Number(fallbackHeight)) {
return { width: snap32(Number(fallbackWidth)), height: snap32(Number(fallbackHeight)) }
}