Skip to content

Fix: Add UI validation for models requiring inputAsset - #75

Merged
timoncool merged 1 commit into
mainfrom
devin/1730055000-fix-flux-kontext-validation
Oct 27, 2025
Merged

Fix: Add UI validation for models requiring inputAsset#75
timoncool merged 1 commit into
mainfrom
devin/1730055000-fix-flux-kontext-validation

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Fix: Add UI validation for models requiring inputAsset

Summary

Fixes a critical issue where FLUX.1 Kontext [pro] and other image-to-image models could be triggered without required image assets, causing API errors. The fix adds UI-level validation that:

  1. Disables the Generate button when a model requires an asset (image/video/audio) but none is selected
  2. Shows a helper message to inform users that the model requires an asset
  3. Improves error logging for FAL API errors to help debug future issues
  4. Adds translations for the helper message in English and Russian

The validation applies to all ~20+ models with inputAsset requirements, including:

  • Image-to-image models (FLUX Kontext variants, Ideogram V3 Edit, Qwen Image, Nano Banana)
  • Image-to-video models (Kling, Veo, Sora, Hailuo, Pika)
  • Video-to-audio models (Mirelo SFX)
  • Audio-based models (Dia TTS Voice Clone, Minimax Music)

Changes by file:

src/components/right-panel.tsx - Added validation logic that checks if endpoint.inputAsset is defined and if the corresponding asset field in generateData is populated. If not, disables button and shows message.

src/data/mutations.ts - Wrapped FAL API submission in try-catch with detailed error logging (message, status, body, response) to surface actual API errors.

messages/en.json, messages/ru.json - Added thisModelRequiresAsset translation key.

Review & Testing Checklist for Human

⚠️ CRITICAL - Check base branch first:

Then test the actual fix:

  • Test FLUX.1 Kontext [pro] WITH image - Should allow generation and work correctly
  • Test FLUX.1 Kontext [pro] WITHOUT image - Button should be disabled, helper text should show
  • Test regular text-to-image model (e.g., FLUX schnell) - Should work normally without requiring image
  • Test another image-to-video model (e.g., Kling 2.5 Turbo) - Should require image to enable button
  • Check translations - Verify helper message displays in both English and Russian
  • Check error logging - Open console, trigger an error with invalid params, verify detailed FAL error appears

Test Plan

  1. Go to https://videosos.vercel.app/ (production)
  2. Open settings, add FAL API key
  3. Select "FLUX.1 Kontext [pro]" model
  4. Try clicking Generate without selecting an image → Button should be disabled with message
  5. Upload or select an image → Button should become enabled
  6. Generate with prompt + image → Should work
  7. Switch to "FLUX schnell" (text-to-image) → Button should work without image
  8. Test in Russian locale to verify translation

Notes

  • Session: https://app.devin.ai/sessions/b087b86581854a9c844a837c8798ce5d
  • Requested by: Ilya Timonin (@timoncool)
  • Branch created from: codex/add-response-handling-for-runware (may need to verify this is correct)
  • Related issue: FLUX.1 Kontext [pro] was failing with API error when no image provided
  • Analysis docs: See /home/ubuntu/HANDOFF_REPORT.md and /home/ubuntu/videosos_model_analysis.md for comprehensive model coverage analysis

⚠️ Important: This PR may accidentally include changes from PR #74 (Runware status polling) if that wasn't merged to main yet. Please verify the diff before merging.

- Disable Generate button when model requires image/video/audio but none selected
- Add helper text showing 'This model requires an asset'
- Add improved error logging for FAL API errors
- Add translations for asset requirement message (EN/RU)
- Fixes FLUX.1 Kontext [pro] generation failure

Resolves issue where FLUX.1 Kontext [pro] and other image-to-image models
could be triggered without required image assets, causing API errors.

Co-Authored-By: Ilya Timonin <timoncool@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel

vercel Bot commented Oct 27, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
videosos Ready Ready Preview Comment Oct 27, 2025 7:36am

@timoncool
timoncool merged commit dcd3839 into main Oct 27, 2025
8 checks passed
@devin-ai-integration
devin-ai-integration Bot deleted the devin/1730055000-fix-flux-kontext-validation branch October 31, 2025 07:58
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