OpenAI's video API only supports 4 specific sizes:
- '1280x720' (landscape 16:9)
- '720x1280' (portrait 9:16)
- '1792x1024' (wide landscape)
- '1024x1792' (tall portrait)
Changes:
- Updated size_mapping to use OpenAI's exact supported sizes
- Map user selections to closest supported size
- Added info logging to show size conversions
- Keep original size mapping for non-OpenAI APIs
- Updated documentation with actual supported sizes
This fixes the 'invalid_value' error for the size parameter.
OpenAI's video API is very specific about the 'seconds' parameter:
- Must be a STRING (not integer)
- Must be one of: "4", "8", or "12"
Changes:
- Convert duration to nearest valid value (4, 8, or 12 seconds)
- Send as string to match OpenAI's requirements
- Added info message when duration is auto-converted
- Updated default model to 'sora-2'
- Updated default duration to 4 (valid value)
- Updated documentation with OpenAI's duration constraints
- Keep flexible duration for non-OpenAI APIs
This fixes the 'invalid_type' error for the seconds parameter.
The error 'failed to parse JSON value' revealed that despite curl examples
using -F flags, OpenAI's video API actually expects JSON POST requests.
- Changed back to JSON format using _request() method
- Simplified code by removing multipart/form-data handling
- Kept debug logging for troubleshooting
- Updated documentation to remove multipart/form-data mention
This should resolve the 400 Bad Request error.
- Added detailed debug output showing URL, model, prompt, and parameters
- Improved error handling to show full API response in error messages
- Fixed form data handling to preserve integer types properly
- Added empty string check before adding parameters
This will help diagnose the 400 Bad Request error
BREAKING FIX: Corrected to match official OpenAI API documentation
- Changed endpoint to /v1/videos (was incorrectly /v1/videos/generations)
- Changed from JSON POST to multipart/form-data POST (OpenAI requirement)
- Fixed image-to-video parameter: 'image' (was incorrectly 'input_reference')
- Updated API client to use requests 'files' parameter for form fields
- Removed incorrect Content-Type header to allow proper boundary setting
Reference: https://platform.openai.com/docs/api-reference/videos/create
- Fixed video generation parameters to match OpenAI's API format
- Convert resolution + aspect_ratio to 'size' parameter (e.g., '1920x1080')
- Convert duration to 'seconds' string format (e.g., '5s')
- Filter out fps parameter for OpenAI (not supported)
- Use 'input_reference' instead of 'image_url' for image-to-video
- Added SaveVideoNode to download and save videos locally
- Supports timestamp placeholders in filenames
- Auto-creates output directories
- Shows file size after download
- Updated QUICKSTART guide with video generation examples
- Updated API client documentation with correct parameter formats
- Full OpenAI-compatible API integration for ComfyUI
- Support for Text, Image, Video, and Speech generation
- Works with OpenAI, Venice.ai, OpenRouter, Together.ai, Ollama, and any OpenAI-compatible API
- Modern comfy_api.latest node format
- 10 nodes: 4 basic + 4 advanced + 2 utility
- Complete documentation and examples
- Model discovery and caching system
- Server routes for API management