Skip to content

Comments

fix: add imageUrl validation for img2video mode#3314

Closed
adhikjoshi wants to merge 1 commit intosimstudioai:mainfrom
adhikjoshi:fix/modelslab-img2video-validation
Closed

fix: add imageUrl validation for img2video mode#3314
adhikjoshi wants to merge 1 commit intosimstudioai:mainfrom
adhikjoshi:fix/modelslab-img2video-validation

Conversation

@adhikjoshi
Copy link

Fixes the validation issue noted in review for PR #3288: ensures imageUrl is required when mode is img2video.

This validation was missing which could cause API errors when calling img2video without providing an imageUrl.

@adhikjoshi adhikjoshi closed this Feb 23, 2026
@vercel
Copy link

vercel bot commented Feb 23, 2026

@adhikjoshi is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 23, 2026

Greptile Summary

This PR adds essential validation to prevent API errors when using ModelsLab's img2video mode. The validation ensures that imageUrl is provided when the mode is set to 'img2video', which is required by the ModelsLab API.

  • Added validation check at lines 981-983 in generateWithModelsLab function
  • Throws clear error message when imageUrl is missing for img2video mode
  • Validation occurs before making the API request, preventing unnecessary API calls

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The change adds a simple, targeted validation that prevents API errors. The validation logic is correct and follows the same pattern used throughout the codebase. No complex logic or side effects introduced.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/app/api/tools/video/route.ts Added imageUrl validation for img2video mode in ModelsLab provider - prevents API errors

Last reviewed commit: 77b846b

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant