022_create_video_model_config.sql 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. -- 视频模型参数配置表
  2. CREATE TABLE IF NOT EXISTS aigcspace.video_model_config (
  3. id SERIAL PRIMARY KEY,
  4. model_name VARCHAR(100) NOT NULL UNIQUE,
  5. model_id VARCHAR(100) NOT NULL,
  6. model_type VARCHAR(50) NOT NULL,
  7. supported_params JSONB NOT NULL,
  8. is_active BOOLEAN DEFAULT TRUE,
  9. created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  10. updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
  11. );
  12. CREATE INDEX IF NOT EXISTS idx_video_model_config_type ON aigcspace.video_model_config(model_type);
  13. CREATE INDEX IF NOT EXISTS idx_video_model_config_active ON aigcspace.video_model_config(is_active);
  14. COMMENT ON TABLE aigcspace.video_model_config IS '视频模型参数配置表';
  15. COMMENT ON COLUMN aigcspace.video_model_config.model_type IS '模型类型:t2v=文生视频,i2v=图生视频,s2v=数字人合成';
  16. -- 初始化模型配置数据
  17. INSERT INTO aigcspace.video_model_config (model_name, model_id, model_type, supported_params) VALUES
  18. ('wan2.2-s2v', 'wan2.2-s2v', 's2v', '{
  19. "resolutions": ["480P", "720P"],
  20. "max_audio_duration": 20,
  21. "max_audio_size_mb": 15,
  22. "audio_formats": ["wav", "mp3"],
  23. "supports_audio": true
  24. }'::jsonb),
  25. ('wan2.2-s2v-detect', 'wan2.2-s2v-detect', 's2v', '{
  26. "image_formats": ["jpg", "jpeg", "png", "bmp", "webp"],
  27. "min_size": 400,
  28. "max_size": 7000
  29. }'::jsonb),
  30. ('wan2.6-t2v', 'wan2.6-t2v', 't2v', '{
  31. "resolutions": ["720P", "1080P"],
  32. "durations": [5, 10, 15],
  33. "max_prompt_length": 1500,
  34. "supports_audio": true,
  35. "supports_audio_url": true,
  36. "supports_multi_shot": true,
  37. "supports_first_frame": false,
  38. "supports_last_frame": false,
  39. "aspect_ratios": {
  40. "720P": ["1280*720", "720*1280", "960*960"],
  41. "1080P": ["1920*1080", "1080*1920", "1440*1440"]
  42. }
  43. }'::jsonb),
  44. ('wan2.6-i2v', 'wan2.6-i2v', 'i2v', '{
  45. "resolutions": ["720P", "1080P"],
  46. "durations": [5, 10, 15],
  47. "max_prompt_length": 1500,
  48. "supports_audio": true,
  49. "supports_audio_url": true,
  50. "supports_multi_shot": false,
  51. "supports_first_frame": true,
  52. "supports_last_frame": true,
  53. "aspect_ratios": {
  54. "720P": ["1280*720", "720*1280", "960*960"],
  55. "1080P": ["1920*1080", "1080*1920", "1440*1440"]
  56. }
  57. }'::jsonb)
  58. ON CONFLICT (model_name) DO NOTHING;