Choose generation mode automatically from starting image
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import type { ImageV2Mode } from './imageV2'
|
||||
|
||||
export function imageModeForInput(mode: ImageV2Mode, hasImage: boolean, hasPasses = false): ImageV2Mode {
|
||||
if (mode === 'compose' || mode === 'refine' || mode === 'iterate') return mode
|
||||
if (!hasImage && hasPasses) return 'iterate'
|
||||
return hasImage ? 'edit' : 'generate'
|
||||
}
|
||||
|
||||
export function videoStartForInput(hasImage: boolean): 'still' | 'text' {
|
||||
return hasImage ? 'still' : 'text'
|
||||
}
|
||||
Reference in New Issue
Block a user