- UAT-001 resolved: fal.ai schema 404 fixed
- ENHANCE-001: Dynamic model input handles based on schema
- ENHANCE-002: Auto-resize node when Parameters expands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use 'models' array instead of 'data' array
- Iterate paths to find POST endpoint (not always at '/')
- Resolve $ref schema references from components.schemas
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous /api endpoint returned 404 for all models. Now using
the correct Model Search API with OpenAPI expansion:
GET https://api.fal.ai/v1/models?endpoint_id={modelId}&expand=openapi-3.0
Also added fallback path traversal for alternate OpenAPI structures.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Many fal.ai models don't expose OpenAPI schemas at /api endpoint.
Return empty parameters instead of error so generation still works
and UI doesn't show error message.
- Mark NanoBananaNode alias as deprecated with migration guidance
- Mark saveNanoBananaDefaults as deprecated with alternative
- ModelSearchDialog already has video capability badges and filtering
- Add inline validation for number/integer parameters with min/max bounds
- Show red border and error text for out-of-range values
- Clear parameters when switching provider or model (schemas differ)
- Validation shows specific constraints (Min/Max values, integer requirement)
- Add modelsFetchError state with retry button in GenerateImage/VideoNode
- Show clear errors when model list fails to load (API key issues, connection)
- Improve API route error messages to include model name
- Add rate limit handling (429) with user-friendly messages
- Parse provider-specific error responses for better detail
- Improve timeout message for video generation
- Include parameters in requestPayload for nanoBanana and generateVideo nodes
- Add logging for custom parameters in Replicate and fal.ai provider functions
- Parameters already spread via ...input.parameters in existing provider code
- Create ModelParameters component with collapsible UI
- Fetches schema from /api/models/{modelId} endpoint
- Renders appropriate inputs based on parameter type (string, number, boolean, enum)
- Add parameters field to NanoBananaNodeData and GenerateVideoNodeData
- Integrate into GenerateImageNode and GenerateVideoNode
- Create /api/models/[modelId] endpoint for fetching model parameter schemas
- Add ModelParameter interface to lib/providers/types.ts
- Support both Replicate and fal.ai providers
- Filter out internal params, prioritize user-relevant ones
- 10-minute cache TTL for schema responses
Tasks completed: 3/3
- Update OutputNode for video detection and playback
- Connect generateVideo output to workflow pipeline
- Bug fix: create generateVideo node for video models in browser
SUMMARY: .planning/phases/06-video-and-polish/06-02-SUMMARY.md
- Check model capabilities when selecting from model browser
- Create generateVideo node for text-to-video or image-to-video models
- Create nanoBanana node for image generation models
- Pass selectedModel with provider, modelId, displayName to node
- Add generateVideo case to getConnectedInputs for downstream nodes
- Update output node execution to detect video content type
- Set video and contentType fields when receiving video content
- Enable Prompt -> GenerateVideo -> Output workflow pipeline
- Add video and contentType fields to OutputNodeData
- Detect video content from data URL prefix or contentType hint
- Render video element with controls, loop, muted autoplay
- Support both base64 data URLs and HTTP URLs for video
- Update lightbox to show video player in fullscreen
- Update placeholder text to 'Waiting for image or video'
- Added to TEXT_TARGET_OPTIONS for text-to-video
- Added to IMAGE_TARGET_OPTIONS for image-to-video
- Fixes UAT-001: node now accessible via connection menu
Extend /api/generate to support video output from Replicate and fal.ai:
- Detect video content type in Replicate response
- Handle fal.ai video.url field for video model responses
- Return video/videoUrl fields with contentType for videos
- Add generateVideo case to executeWorkflow and regenerateNode
- Handle large videos (>20MB) by returning URL directly
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add GenerateVideoNode for video generation using Replicate and fal.ai:
- Add GenerateVideoNodeData interface with video output field
- Add generateVideo to NodeType union
- Create GenerateVideoNode component with provider/model selection
- Register in WorkflowCanvas with purple minimap color (#9333ea)
- Add default dimensions and node data creation in store
- Update validation.ts for new node type
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 06: Video & Polish
- 4 plans created (06-01 through 06-04)
- 11 total tasks defined
- Addresses ISS-001 (model parameter adaptation)
Plans:
- 06-01: GenerateVideo node with video model selector
- 06-02: Video playback in output node
- 06-03: Custom model parameters from provider schemas
- 06-04: Edge case handling and final polish
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Import uploadImageForUrl, shouldUseImageUrl, deleteImages from @/lib/images
- Process images for Replicate/fal providers before generation
- Small images (<256KB) use data URIs directly
- Large images converted to temporary URLs via /api/images/[id]
- Cleanup uploaded images in finally block (success or failure)
- Gemini path unchanged (handles base64 directly)
- Add image parameter to predictionInput when images array provided
- Log image input presence for debugging
- Uses 'image' param name (most common for img2img models)
Phase 05: Image URL Server
- 2 plans created
- 6 total tasks defined
- Request-scoped cleanup (no TTL) to prevent memory accumulation
- Ready for execution
- Extract last segment from model ID (e.g., "effects" from "kling-video/v1.6/pro/effects")
- Append as suffix if not already in name: "Kling 1.6 - effects"
- Helps differentiate model variants with same display name
- Show all capability badges (txt→img, img→img, txt→vid, img→vid)
- Display model ID below name to differentiate similar models
- Larger cover images (20x20 instead of 16x16)
- Taller cards with 3-line description (was 2)
- Better visual differentiation for fal.ai model variants
- Replicate's search API endpoint unreliable, use client-side filtering
- Always cache full model list for Replicate (not per-search-query)
- Apply search filter on cached models for faster subsequent searches
- Remove unused ReplicateSearchResponse and ReplicateSearchResult types
- Add ModelSearchDialog with search, provider filter, and capability filter
- Integrate with /api/models endpoint using API key headers
- Display model grid with cover images, provider badges, and descriptions
- Update addNode to accept optional initialData for pre-configured nodes
- Replace placeholder in FloatingActionBar with actual dialog
- Dialog opens when provider icon is clicked with provider filter in state
- Placeholder UI shows "Coming in 04-02" message
- Close button properly resets modelSearchOpen state
- Ready for 04-02 to implement full search functionality
- Add modelSearchOpen/modelSearchProvider state to workflowStore
- Add setModelSearchOpen action to toggle dialog with provider filter
- Add ProviderIconButton component with Replicate (R) and fal.ai (lightning) icons
- Replicate icon only visible when API key is configured
- fal.ai icon always visible (works without key but rate limited)
- Add useEffect to migrate legacy nodes without selectedModel on mount
- Derive selectedModel from model field for legacy workflows
- Ensures UI reflects correct provider/model for migrated nodes
- Add API key headers (X-Replicate-API-Key, X-Fal-API-Key) for external providers
- Include selectedModel in request payload for provider routing
- Update logging to show provider-specific info
- Apply same changes to regenerateNode for consistency
- Migrate nanoBanana nodes without selectedModel on workflow load
- Derive selectedModel from legacy model field (nano-banana, nano-banana-pro)
- Set provider to gemini and appropriate displayName for migrated nodes
Refactor generate API route to support multiple providers:
- Accept both legacy format and new format with selectedModel
- Route requests to Replicate, fal.ai, or Gemini based on provider
- Extract Gemini logic into generateWithGemini() helper function
- Add generateWithReplicate() and generateWithFal() server-side helpers
- Get provider API keys from request headers (X-Replicate-API-Key, X-Fal-API-Key)
- Preserve backward compatibility for existing Gemini-based workflows
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implement generation via fal.ai's fal.run API:
- POST to https://fal.run/{modelId} with prompt and parameters
- Use "Key {apiKey}" auth header (works without key but rate limited)
- Extract image URL from response (handles images array, image object, or output string)
- Fetch image and convert to base64 data URL
- Return GenerationOutput with type: "image"
Note: Image inputs skipped for now (Phase 5 adds URL server)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>