Skip to content

Commit 3f9cda1

Browse files
committed
fix: add imageUrl validation for img2video mode
When model is set to 'img2video', the imageUrl parameter is required. This validation was flagged in the Greptile review and is now fixed.
1 parent 30de635 commit 3f9cda1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

apps/sim/app/api/tools/video/route.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,12 @@ async function generateWithModelsLab(
976976
logger.info(`[${requestId}] Starting ModelsLab video generation, mode: ${mode}`)
977977

978978
const isImg2Video = mode === 'img2video'
979+
980+
// Validate img2video requires imageUrl
981+
if (isImg2Video && !imageUrl) {
982+
throw new Error('imageUrl is required for img2video mode')
983+
}
984+
979985
const endpoint = isImg2Video
980986
? 'https://modelslab.com/api/v6/video/img2video'
981987
: 'https://modelslab.com/api/v6/video/text2video'

0 commit comments

Comments
 (0)