From 01606b2949cf67123085e45c8634db405978cce2 Mon Sep 17 00:00:00 2001 From: "mula.liu" Date: Fri, 6 Nov 2026 16:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E9=85=8D=E7=BD=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=8C=85=E8=BF=9B=E4=BB=93=E5=BA=93=EF=BC=9A=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BB=A3=E7=A0=81=E4=B8=8E=E5=90=8C=E6=AD=A5=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E9=85=8D=E7=BD=AE=E8=B5=B0=E5=90=8C=E4=B8=80=E6=9D=A1?= =?UTF-8?q?=E9=80=9A=E9=81=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 开发机 16:42 重新 export 的部署数据集,按「git 同步到服务器」的口径显式纳入版本控制。 这三个 JSON 是 scripts/seed.py export 的产物,一直被 .gitignore 第 62 行挡着(历来只随 deploy.sh 的部署包 rsync 过去),这次用 git add -f 落进仓库,让服务器 git pull 之后 直接 python scripts/seed.py install 就能把模型配置刷进库,不必再单独传一次文件。 - model_specs.json 8 条(4 个真实模型 + 4 条 mock):默认位 image=comfyui/qwen-image-2.1-turbo、 llm=qwen/qwen3.7-plus、tts=comfyui/indextts2、video=comfyui/minimax-h3;ComfyUI 三条的 base_url 是算力机内网地址 10.100.53.199:9200,服务器换网段要在模型管理中心改; - model_secret_keys.json 是**机密**:那行 key_value 能解开全部 API Key 密文,与密文同级, 仓库必须保持私有; - users.json 只有 admin,口令是 PBKDF2 哈希,install 对已存在的账号不改口令。 验证 - seed.py doctor --src scripts/seed → 判定通过(error 0 · warn 0):带 Key 1 条 (qwen/qwen3.7-plus)主密钥解密通过 · 主密钥 1 条 · 管理员 admin · 每类能力恰好一个默认。 --- scripts/seed/model_secret_keys.json | 15 ++ scripts/seed/model_specs.json | 392 ++++++++++++++++++++++++++++ scripts/seed/users.json | 24 ++ 3 files changed, 431 insertions(+) create mode 100644 scripts/seed/model_secret_keys.json create mode 100644 scripts/seed/model_specs.json create mode 100644 scripts/seed/users.json diff --git a/scripts/seed/model_secret_keys.json b/scripts/seed/model_secret_keys.json new file mode 100644 index 0000000..ae67fc8 --- /dev/null +++ b/scripts/seed/model_secret_keys.json @@ -0,0 +1,15 @@ +{ + "_meta": { + "table": "model_secret_keys", + "count": 1, + "note": "密钥加密主密钥;缺了它 model_specs.api_key_encrypted 解不开" + }, + "rows": [ + { + "id": 1, + "key_value": "JpdlaRwZrycwCP3P2GE5MOrHkdWr3HYI78-1hgBK_yA=", + "created_at": "2026-10-23 08:09:56.881541", + "updated_at": "2026-10-23 08:09:56.881545" + } + ] +} diff --git a/scripts/seed/model_specs.json b/scripts/seed/model_specs.json new file mode 100644 index 0000000..d8c3f99 --- /dev/null +++ b/scripts/seed/model_specs.json @@ -0,0 +1,392 @@ +{ + "_meta": { + "table": "model_specs", + "count": 8, + "defaults": [ + "image=comfyui/qwen-image-2.1-turbo", + "llm=qwen/qwen3.7-plus", + "tts=comfyui/indextts2", + "video=comfyui/minimax-h3" + ], + "exported_at": "2026-11-06T16:42:16" + }, + "rows": [ + { + "id": 3, + "provider": "comfyui", + "model": "minimax-h3", + "display_name": "ComfyUI · minimax-h3", + "media_type": "video", + "adapter": "comfyui", + "enabled": true, + "is_default": true, + "status": "ready", + "model_code": "", + "timeout_seconds": 120, + "api_key_encrypted": "", + "max_concurrency": 1, + "requests_per_minute": 6, + "burst": 1, + "modes": [ + "t2v", + "i2v", + "fl" + ], + "resolutions": [ + "480p", + "720p" + ], + "aspect_ratios": [], + "min_duration": 5.0, + "max_duration": 15.0, + "max_reference_images": 6, + "price_per_second": 0.0, + "price_per_1k_chars": 0.0, + "currency": "CNY", + "default_params": {}, + "config_json": { + "base_url": "http://10.100.53.199:9200", + "workflow": "minimax_h3", + "models": { + "unet": "minimax_h3_ref2va_pruned_int8_convrot.safetensors", + "clip": "qwen3vl_32b_minimax_h3_nvfp4_awq.safetensors", + "clip_type": "minimax", + "video_vae": "minimax_h3_video_vae_fp16.safetensors", + "audio_vae": "minimax_h3_audio_vae_fp32.safetensors" + }, + "steps": 4, + "sampler": "res_multistep", + "scheduler": "simple", + "fps": 24, + "megapixels": 0.98, + "multiple": 32, + "input_subfolder": "nex_predator", + "filename_prefix": "nex_predator/1792639651", + "poll_interval": 5, + "timeout": 900, + "use_reference_images": true, + "unet_loader": "UNETLoader", + "clip_loader": "CLIPLoader", + "weight_dtype": "default", + "clip_device": "default", + "lora": "minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors", + "lora_strength": 1.0, + "max_edge": 1344, + "lora_ref2v": "minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors", + "lora_i2v": "minimax_h3_fl2v_turbo_4step_v1.0_768p_comfyui_bf16.safetensors", + "ref_image_size": "match", + "resolution_policy": "config" + }, + "notes": "自建 ComfyUI 工作流(MiniMax H3 原生音画同步)。镜头时长需在模型区间内,实际时长按 24fps 的 17 帧网格向上取整", + "created_at": "2026-10-21 04:44:16.134160", + "updated_at": "2026-11-05 08:29:49.727559" + }, + { + "id": 8, + "provider": "comfyui", + "model": "qwen-image-2.1-turbo", + "display_name": "Qwen-Image-2.1-Turbo(本地)", + "media_type": "image", + "adapter": "comfyui_image", + "enabled": true, + "is_default": true, + "status": "ready", + "model_code": "", + "timeout_seconds": 120, + "api_key_encrypted": "", + "max_concurrency": 1, + "requests_per_minute": 6, + "burst": 1, + "modes": [ + "t2i", + "edit" + ], + "resolutions": [ + "1024p", + "2k" + ], + "aspect_ratios": [ + "1:1", + "16:9", + "9:16", + "4:3", + "3:4" + ], + "min_duration": 0.0, + "max_duration": 0.0, + "max_reference_images": 4, + "price_per_second": 0.0, + "price_per_1k_chars": 0.0, + "currency": "CNY", + "default_params": {}, + "config_json": { + "base_url": "http://10.100.53.199:9200", + "workflow": "qwen_image_2_1_turbo", + "models": { + "unet": "qwen-image-2.1-turbo-Q4_K_M.gguf", + "clip": "qwen3vl_8b_int8_convrot.safetensors", + "vae": "qwen_image_2.1_vae_bf16.safetensors" + }, + "sampler": "euler", + "cfg": 1.0, + "sigmas": "1.0, 0.978453, 0.95418, 0.926626, 0.89508, 0.845148, 0.704534, 0.414568, 0", + "encoder_resolution": 1024, + "cache_device": "auto", + "cache_dtype": "default", + "filename_prefix": "nex/asset", + "poll_interval": 2, + "timeout": 1800, + "resource_group": "comfyui:9200" + }, + "notes": "9200 本地 GGUF,8 步蒸馏;支持参考图编辑,与 H3、IndexTTS 共用 GPU 串行调度", + "created_at": "2026-10-23 06:09:38.063862", + "updated_at": "2026-10-27 09:01:03.895660" + }, + { + "id": 9, + "provider": "comfyui", + "model": "indextts2", + "display_name": "IndexTTS2(本地音色克隆)", + "media_type": "tts", + "adapter": "comfyui_tts", + "enabled": true, + "is_default": true, + "status": "ready", + "model_code": "", + "timeout_seconds": 120, + "api_key_encrypted": "", + "max_concurrency": 1, + "requests_per_minute": 12, + "burst": 1, + "modes": [ + "voice", + "voice_clone", + "voice_instruct" + ], + "resolutions": [], + "aspect_ratios": [], + "min_duration": 0.0, + "max_duration": 0.0, + "max_reference_images": 1, + "price_per_second": 0.0, + "price_per_1k_chars": 0.0, + "currency": "CNY", + "default_params": {}, + "config_json": { + "base_url": "http://10.100.53.199:9200", + "workflow": "indextts2", + "model": "IndexTTS-2", + "download_from": "modelscope", + "load_node": "easy downloadIndexTTSAndLoadModel", + "generate_node": "easy indexTTSGenerateSimple", + "reference_audio": "nex_tts_reference.wav", + "input_subfolder": "nex_animation", + "filename_prefix": "audio/nex", + "poll_interval": 1, + "timeout": 900, + "resource_group": "comfyui:9200", + "generate_full_node": "easy indexTTSGenerate", + "instruct_node": "easy indexTTSEmotionText" + }, + "notes": "9200 本地 IndexTTS2;通过声线的参考音频 ID / 本地音频文件做音色克隆", + "created_at": "2026-10-23 06:09:38.064050", + "updated_at": "2026-11-05 08:29:49.727800" + }, + { + "id": 10, + "provider": "qwen", + "model": "qwen3.7-plus", + "display_name": "Qwen3.7", + "media_type": "llm", + "adapter": "http_llm", + "enabled": true, + "is_default": true, + "status": "ready", + "model_code": "llm_qwen3.7", + "timeout_seconds": 300, + "api_key_encrypted": "IpxVxYb3gerkDUXA3W3EfsN67mWk7d3_CYeWkNswH6s_WDoJsZkClmahLUmWP7_3S0h1d60qTu7nDZ7cilKkww6HmwyDgS6etxtWSK7GI2B2Eg==", + "max_concurrency": 4, + "requests_per_minute": 120, + "burst": 2, + "modes": [ + "chat", + "prompt" + ], + "resolutions": [], + "aspect_ratios": [], + "min_duration": 0.0, + "max_duration": 0.0, + "max_reference_images": 0, + "price_per_second": 0.0, + "price_per_1k_chars": 0.0, + "currency": "CNY", + "default_params": { + "temperature": 0.1, + "top_p": 0.97, + "max_tokens": 32768 + }, + "config_json": { + "base_url": "https://coding.dashscope.aliyuncs.com/v1", + "model": "qwen3.7-plus" + }, + "notes": "OpenAI 兼容真实大模型,用于人物/场景提示词补全、文案改写与分镜文本生成;密钥加密存储。", + "created_at": "2026-10-23 08:09:56.883206", + "updated_at": "2026-11-03 10:23:02.083984" + }, + { + "id": 12, + "provider": "mock", + "model": "mock-video-1", + "display_name": "Mock 视频(流水线自检)", + "media_type": "video", + "adapter": "mock", + "enabled": true, + "is_default": false, + "status": "ready", + "model_code": "", + "timeout_seconds": 120, + "api_key_encrypted": "", + "max_concurrency": 2, + "requests_per_minute": 60, + "burst": 1, + "modes": [ + "t2v", + "i2v", + "fl" + ], + "resolutions": [ + "480p", + "720p", + "1080p" + ], + "aspect_ratios": [ + "16:9", + "9:16", + "1:1", + "4:3", + "3:4", + "21:9" + ], + "min_duration": 1.0, + "max_duration": 30.0, + "max_reference_images": 4, + "price_per_second": 0.0, + "price_per_1k_chars": 0.0, + "currency": "CNY", + "default_params": {}, + "config_json": {}, + "notes": "生成模拟运镜片段,用于验证任务编排、质检与合成链路;不是真实 AI 视频", + "created_at": "2026-10-27 08:56:53.507012", + "updated_at": "2026-10-27 08:56:53.507013" + }, + { + "id": 13, + "provider": "mock", + "model": "mock-tts-1", + "display_name": "Mock 配音(占位人声)", + "media_type": "tts", + "adapter": "mock", + "enabled": true, + "is_default": false, + "status": "ready", + "model_code": "", + "timeout_seconds": 120, + "api_key_encrypted": "", + "max_concurrency": 4, + "requests_per_minute": 120, + "burst": 1, + "modes": [ + "voice" + ], + "resolutions": [], + "aspect_ratios": [], + "min_duration": 1.0, + "max_duration": 10.0, + "max_reference_images": 0, + "price_per_second": 0.0, + "price_per_1k_chars": 0.0, + "currency": "CNY", + "default_params": {}, + "config_json": {}, + "notes": "按文本长度生成占位人声,用于验证配音、字幕对齐与混音", + "created_at": "2026-10-27 08:56:53.507303", + "updated_at": "2026-10-27 09:01:00.744652" + }, + { + "id": 14, + "provider": "mock", + "model": "mock-image-1", + "display_name": "Mock 图像(资产自检)", + "media_type": "image", + "adapter": "mock_image", + "enabled": true, + "is_default": false, + "status": "ready", + "model_code": "", + "timeout_seconds": 120, + "api_key_encrypted": "", + "max_concurrency": 4, + "requests_per_minute": 60, + "burst": 1, + "modes": [ + "t2i", + "edit" + ], + "resolutions": [ + "512p", + "1024p" + ], + "aspect_ratios": [ + "1:1", + "16:9", + "9:16", + "4:3" + ], + "min_duration": 0.0, + "max_duration": 0.0, + "max_reference_images": 4, + "price_per_second": 0.0, + "price_per_1k_chars": 0.0, + "currency": "CNY", + "default_params": {}, + "config_json": {}, + "notes": "按提示词生成真实可打开的构图 PNG,用于验证角色定妆图、场景图与资产生成链路;不是真实 AI 绘图模型", + "created_at": "2026-10-27 08:56:53.507591", + "updated_at": "2026-10-27 09:01:03.895193" + }, + { + "id": 15, + "provider": "mock", + "model": "mock-llm-1", + "display_name": "Mock 大模型(离线自检)", + "media_type": "llm", + "adapter": "mock_llm", + "enabled": true, + "is_default": false, + "status": "ready", + "model_code": "", + "timeout_seconds": 120, + "api_key_encrypted": "", + "max_concurrency": 4, + "requests_per_minute": 60, + "burst": 1, + "modes": [ + "chat", + "prompt" + ], + "resolutions": [], + "aspect_ratios": [], + "min_duration": 0.0, + "max_duration": 0.0, + "max_reference_images": 0, + "price_per_second": 0.0, + "price_per_1k_chars": 0.0, + "currency": "CNY", + "default_params": {}, + "config_json": {}, + "notes": "离线大模型:仅验证结构化文本与提示词链路;图像生成请使用独立图像模型", + "created_at": "2026-10-27 08:56:53.507793", + "updated_at": "2026-10-27 09:00:42.558507" + } + ] +} diff --git a/scripts/seed/users.json b/scripts/seed/users.json new file mode 100644 index 0000000..4dbb99b --- /dev/null +++ b/scripts/seed/users.json @@ -0,0 +1,24 @@ +{ + "_meta": { + "table": "users", + "count": 1, + "note": "只导管理员;口令是 PBKDF2 哈希,不含明文" + }, + "rows": [ + { + "id": 1, + "username": "admin", + "display_name": "平台管理员", + "email": "", + "password_hash": "pbkdf2_sha256$180000$qaixn-FvRZ9-KfxxeskdUQ$f47df46b72273583ec549869e454ad22e31d56c4f4f288d8e16962b47add494b", + "role": "admin", + "is_active": true, + "must_change_password": false, + "note": "系统初始化自动创建,请尽快修改默认密码", + "prefs_json": {}, + "created_by_id": null, + "created_at": "2026-10-27 08:56:53.524106", + "updated_at": "2026-11-05 17:13:26.239575" + } + ] +}