From c24c2fd0e0583e2809ee1b03db20f46444ba3d2a Mon Sep 17 00:00:00 2001
From: Xinfan Chen <2024111082@stu.hit.edu.cn>
Date: Fri, 24 Apr 2026 13:47:48 +0800
Subject: [PATCH] add deepseek-v4 wan2.7-image gpt-image-2
---
aigc-director/aigc-claw/backend/config_model.json | 43 ++++++
aigc-director/README.md | 57 +++++----
aigc-director/references/sandbox/generate_image_t2i.md | 8
aigc-director/aigc-claw/frontend/config/models.ts | 11 +
aigc-director/aigc-claw/backend/tool/image_gpt.py | 93 +++++++++++++--
aigc-director/aigc-claw/backend/tool/video_seedance.py | 59 +++++----
aigc-director/aigc-claw/frontend/components/Sandbox/Sandbox.tsx | 6
aigc-director/aigc-claw/frontend/components/HomePage.tsx | 10
aigc-director/aigc-claw/backend/tool/image_dashscope.py | 43 ++++++-
README.md | 18 +-
aigc-director/aigc-claw/backend/tool/llm_deepseek.py | 6
11 files changed, 250 insertions(+), 104 deletions(-)
diff --git a/README.md b/README.md
index deb4908..8ea5751 100644
--- a/README.md
+++ b/README.md
@@ -327,12 +327,12 @@
```bash
# LLM 配置
-LLM_MODEL=qwen3.5-plus
-VLM_MODEL=qwen-vl-plus
+LLM_MODEL=qwen3.6-max-preview
+VLM_MODEL=qwen3.6-plus
# 图像生成
-IMAGE_T2I_MODEL=doubao-seedream-5-0-260128
-IMAGE_IT2I_MODEL=doubao-seedream-5-0-260128
+IMAGE_T2I_MODEL=wan2.7-image
+IMAGE_IT2I_MODEL=wan2.7-image
# 视频生成
VIDEO_MODEL=wan2.7-i2v
@@ -348,11 +348,11 @@
| 类型 | 模型 |
|:---:|:---|
-| **LLM** | qwen3.5-plus, deepseek-chat, gpt-4o, gemini-2.5-flash |
-| **VLM** | qwen-vl-plus, gemini-2.5-flash-image |
-| **文生图** | doubao-seedream-5-0, jimeng_t2i_v40, wan2.6-t2i |
-| **图生图** | doubao-seedream-5-0, jimeng_t2i_v40, wan2.6-image |
-| **视频生成** | doubao-seedance-2-0-260128, wan2.7-i2v, wan2.6-i2v-flash, kling-v3 |
+| **LLM** | qwen3.6-max-preview, qwen3-max, deepseek-chat, deepseek-reasoner, deepseek-v4-flash, deepseek-v4-pro, gpt-4o, gpt-5, gpt-5.4, gemini-2.5-flash, gemini-2.0-flash, kimi-k2.6 |
+| **VLM** | qwen3.6-plus, qwen3.6-flash, kimi-k2.6, gpt-5.4, gemini-2.5-flash-image, gemini-2.0-flash |
+| **文生图** | wan2.7-image, wan2.7-image-pro, wan2.6-t2i, jimeng_t2i_v40, doubao-seedream-5.0/4.5/4.0, gpt-image-2 |
+| **图生图** | wan2.7-image, wan2.7-image-pro, jimeng_t2i_v40, doubao-seedream-5.0/4.5/4.0, gpt-image-2 |
+| **视频生成** | wan2.7-i2v, wan2.6-i2v-flash, doubao-seedance-2.0 (Normal/Fast), kling-v3/v2.6/v2.5 |
</details>
diff --git a/aigc-director/README.md b/aigc-director/README.md
index 51dfa88..bd29a08 100644
--- a/aigc-director/README.md
+++ b/aigc-director/README.md
@@ -219,14 +219,14 @@
```bash
# LLM 配置(剧本生成)
-LLM_MODEL=qwen3.5-plus
+LLM_MODEL=qwen3.6-max-preview
# VLM 配置(图像评估)
-VLM_MODEL=qwen-vl-plus
+VLM_MODEL=qwen3.6-plus
-# 图像生成(默认:doubao-seedream-5-0-260128,支持高并发)
-IMAGE_T2I_MODEL=doubao-seedream-5-0-260128
-IMAGE_IT2I_MODEL=doubao-seedream-5-0-260128
+# 图像生成(默认:wan2.6-t2i)
+IMAGE_T2I_MODEL=wan2.6-t2i
+IMAGE_IT2I_MODEL=wan2.6-t2i
# 视频生成
VIDEO_MODEL=wan2.7-i2v
@@ -239,21 +239,21 @@
| API Key | 提供商 | 可用模型 |
|---------|------|---------|
-| `DASHSCOPE_API_KEY` | 阿里云DashScope | qwen3.5-plus, qwen-vl-plus, wan2.6-t2i, wan2.6-i2v-flash |
+| `DASHSCOPE_API_KEY` | 阿里云DashScope | qwen3.6-max-preview, qwen3.6-plus, wan2.6-t2i, wan2.7-i2v, wan2.6-i2v-flash |
| `ARK_API_KEY` | 字节跳动Seedream | doubao-seedream-5-0-260128 (500次/分钟,高并发) |
| `VOLC_ACCESS_KEY/SECRET` | 火山引擎即梦 | jimeng_t2i_v40, jimeng_ti2v_v30_pro |
-| `KLING_ACCESS_KEY/SECRET` | 快手可灵 | kling-v3, kling-v2-6 |
-| `DEEPSEEK_API_KEY` | DeepSeek | deepseek-chat, deepseek-reasoner |
-| `OPENAI_API_KEY` | OpenAI | gpt-4o, gpt-5, o3 |
-| `GEMINI_API_KEY` | Google Gemini | gemini-2.5-flash, gemini-2.5-flash-image |
+| `KLING_ACCESS_KEY/SECRET` | 快手可灵 | kling-v3, kling-v2-6, kling-v2-5-turbo |
+| `DEEPSEEK_API_KEY` | DeepSeek | deepseek-chat, deepseek-reasoner, deepseek-v4-flash, deepseek-v4-pro |
+| `OPENAI_API_KEY` | OpenAI | gpt-4o, gpt-5, gpt-5.4, sora_image, gpt-image-2 |
+| `GEMINI_API_KEY` | Google Gemini | gemini-2.5-flash, gemini-2.5-flash-image, gemini-2.0-flash |
### 可用模型
-- **LLM 模型**: deepseek-chat, deepseek-reasoner, gpt-4o, gpt-4, gpt-5, o3, gemini-3-flash-preview, qwen3.5-plus, qwen3.5-max
-- **VLM 评估模型**: qwen3.5-plus, qwen-vl-plus, qwen3.5-max, gemini-2.5-flash-image (性价比最高), gemini-2.0-flash
-- **文生图模型**: doubao-seedream-5-0-260128, jimeng_t2i_v40, wan2.6-t2i, sora_image, gpt-image-2
-- **图生图模型**: doubao-seedream-5-0-260128, jimeng_t2i_v40, wan2.6-image
-- **视频生成模型**: doubao-seedance-2-0-260128, wan2.7-i2v, wan2.6-i2v-flash, kling-v3, kling-v2-6, kling-v2-5-turbo
+- **LLM 模型**: qwen3.6-max-preview, qwen3-max, deepseek-chat, deepseek-reasoner, deepseek-v4-flash, deepseek-v4-pro, gpt-4o, gpt-5, gpt-5.4, gemini-2.5-flash, gemini-2.0-flash
+- **VLM 评估模型**: qwen3.6-plus, qwen3.6-flash, kimi-k2.6, gpt-5.4, gemini-2.5-flash-image (性价比最高), gemini-2.0-flash
+- **文生图模型**: wan2.6-t2i, jimeng_t2i_v40, doubao-seedream-5-0-260128, sora_image, gpt-image-2
+- **图生图模型**: wan2.6-t2i, jimeng_t2i_v40, doubao-seedream-5-0-260128, gpt-image-2
+- **视频生成模型**: wan2.7-i2v, wan2.6-i2v-flash, doubao-seedance-2-0-260128, kling-v3, kling-v2-6, kling-v2-5-turbo, jimeng_ti2v_v30_pro
- **视频比例**: 16:9, 9:16, 1:1, 4:3, 3:4, 21:9
### 并发配置
@@ -281,29 +281,32 @@
| 模型 | 调用限制 | 并发数上限 | 备注 |
|------|---------|-----------|------|
-| **wan2.6-t2i** | 1次/秒 | 5个 | 文生图 |
-| **wan2.6-image** | 5次/秒 | 5个 | 图像生成 |
-| **jimeng_t2i_v40** | - | 2-5个 | 即梦系列 |
-| **doubao-seedream-*** | 500次/分钟 | 高并发 | 字节跳动Seedream |
-| **qwen-image** | 2次/秒 | 同步无限制 | 需开通 |
+| **wan2.6-t2i** | 1次/秒 | 5个 | 文生图/图生图 |
+| **jimeng_t2i_v40** | - | 2个 | 即梦系列 |
+| **doubao-seedream-*** | 500次/分钟 | 10个 | 字节跳动Seedream |
+| **sora_image** | - | 3个 | OpenAI |
+| **gpt-image-2** | - | 3个 | OpenAI |
#### 视频生成
| 模型 | 调用限制 | 并发数上限 | 备注 |
|------|------|------|------|
-| **wan2.6-i2v-flash** | 5次/秒 | 5个 | 首帧生视频 |
-| **wan2.6-i2v** | 5次/秒 | 5个 | 首帧生视频 |
-| **jimeng_ti2v_v30_pro** | 即梦视频,需实测限流 | | |
-| **kling-v3/v2-6** | 快手可灵,需查阅官方文档 | | |
+| **wan2.7-i2v** | 5次/秒 | 5个 | 阿里大模型 |
+| **wan2.6-i2v-flash** | 5次/秒 | 5个 | 阿里大模型 (快速) |
+| **doubao-seedance-*** | - | 10个 | 字节跳动 |
+| **kling-v3/v2-6/v2-5** | - | 3个 | 快手可灵 |
+| **jimeng_ti2v_v30_pro** | - | 3个 | 即梦视频 |
#### LLM / VLM
| 模型 | RPM | TPM |
|------|-----|-----|
-| **qwen3.5-plus** | 30,000 | 5,000,000 |
-| **qwen-plus** | 30,000 | 5,000,000 |
-| **qwen-vl-plus** | 1,200 | 1,000,000 |
+| **qwen3.6-max-preview** | 30,000 | 5,000,000 |
+| **qwen3.6-plus** | 30,000 | 5,000,000 |
| **deepseek-chat** | 15,000 | 1,200,000 |
+| **deepseek-v4-flash** | 1,000 | 4,000 |
+| **deepseek-v4-pro** | 2,000 | 8,000 |
+| **gpt-4o** | - | - |
> **RPM**: 每分钟请求数 | **TPM**: 每分钟Token数
diff --git a/aigc-director/aigc-claw/backend/config_model.json b/aigc-director/aigc-claw/backend/config_model.json
index 4c8c165..8ef3488 100644
--- a/aigc-director/aigc-claw/backend/config_model.json
+++ b/aigc-director/aigc-claw/backend/config_model.json
@@ -16,6 +16,22 @@
"price_per_1k_input_token": 0.004,
"price_per_1k_output_token": 0.016
},
+ "deepseek-v4-flash": {
+ "name": "DeepSeek V4 Flash",
+ "provider": "deepseek",
+ "type": ["llm"],
+ "concurrency": 10,
+ "price_per_1k_input_token": 0.001,
+ "price_per_1k_output_token": 0.004
+ },
+ "deepseek-v4-pro": {
+ "name": "DeepSeek V4 Pro",
+ "provider": "deepseek",
+ "type": ["llm"],
+ "concurrency": 10,
+ "price_per_1k_input_token": 0.002,
+ "price_per_1k_output_token": 0.008
+ },
"gpt-4o": {
"name": "GPT-4o",
"provider": "openai",
@@ -83,7 +99,7 @@
"kimi-k2.6": {
"name": "Kimi K2.6",
"provider": "qwen",
- "type": ["vlm"],
+ "type": ["llm", "vlm"],
"concurrency": 10,
"price_per_1k_input_token": 0.001,
"price_per_1k_output_token": 0.003
@@ -119,10 +135,24 @@
"concurrency": 2,
"price_per_image": 0.22
},
+ "wan2.7-image": {
+ "name": "Wan 2.7 Image",
+ "provider": "dashscope",
+ "type": ["t2i", "i2i"],
+ "concurrency": 5,
+ "price_per_image": 0.2
+ },
+ "wan2.7-image-pro": {
+ "name": "Wan 2.7 Image Pro",
+ "provider": "dashscope",
+ "type": ["t2i", "i2i"],
+ "concurrency": 5,
+ "price_per_image": 0.4
+ },
"wan2.6-t2i": {
"name": "Wan 2.6 T2I",
"provider": "dashscope",
- "type": ["t2i", "i2i"],
+ "type": ["t2i"],
"concurrency": 5,
"price_per_image": 0.2
},
@@ -157,7 +187,7 @@
"gpt-image-2": {
"name": "GPT Image 2",
"provider": "openai",
- "type": ["t2i"],
+ "type": ["t2i", "i2i"],
"concurrency": 3,
"price_per_image": 1.09
},
@@ -203,6 +233,13 @@
"concurrency": 10,
"price_per_second": 0.5
},
+ "doubao-seedance-2-0-fast-260128": {
+ "name": "Seedance 2.0 Fast",
+ "provider": "seedance",
+ "type": ["video"],
+ "concurrency": 10,
+ "price_per_second": 0.3
+ },
"jimeng_ti2v_v30_pro": {
"name": "JiMeng Ti2V V30 Pro",
"provider": "jimeng",
diff --git a/aigc-director/aigc-claw/backend/tool/image_dashscope.py b/aigc-director/aigc-claw/backend/tool/image_dashscope.py
index 25d162c..cf63149 100644
--- a/aigc-director/aigc-claw/backend/tool/image_dashscope.py
+++ b/aigc-director/aigc-claw/backend/tool/image_dashscope.py
@@ -20,7 +20,7 @@
dashscope.base_http_api_url = self.base_url
self.image_processor = ImageProcessor()
- def generate_image(self, prompt, model="wan2.6-t2i", size="1024*1024", n=1, session_id=None, save_dir=None):
+ def generate_image(self, prompt, model="wan2.7-image", size="1024*1024", n=1, session_id=None, save_dir=None):
"""
Text to Image generation using DashScope
"""
@@ -65,7 +65,7 @@
logging.error(f"Error in generate_image (DashScope): {e}")
return []
- def edit_image(self, prompt, image_urls, model="wan2.6-image", size="1920*1080", n=1, session_id=None, save_dir=None):
+ def edit_image(self, prompt, image_urls, model="wan2.7-image", size="1920*1080", n=1, session_id=None, save_dir=None):
"""
Image editing/compositing using DashScope ImageGeneration
"""
@@ -136,11 +136,12 @@
if __name__ == "__main__":
import sys
- import tempfile
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from config import Config
print("=== DashScope 图片生成可用性测试 ===")
+ MODELS=["wan2.6-t2i", "wan2.7-image", "wan2.7-image-pro"]
+ save_dir = "code/result/image/test_avail"
api_key = Config.DASHSCOPE_API_KEY
base_url = Config.DASHSCOPE_BASE_URL
if not api_key:
@@ -149,14 +150,42 @@
print(f" API Key: {api_key[:6]}***{api_key[-4:]}")
print(f" Base URL: {base_url}")
client = DashScopeClient(api_key=api_key, base_url=base_url)
+
+ # 文生图
+ print("\n=== 文生图测试 ===")
prompt = "一只橘猫躺在阳光下的窗台上,水彩画风格"
- print(f"Prompt: {prompt}")
- with tempfile.TemporaryDirectory() as tmp:
+ for model in MODELS:
+ print(f"\nPrompt: {prompt}")
+ print(f"model: {model}")
+ os.makedirs(save_dir, exist_ok=True)
t0 = time.time()
try:
paths = client.generate_image(
- prompt=prompt, model="wan2.6-t2i",
- size="1024*1024", save_dir=tmp,
+ prompt=prompt, model=model,
+ size="1024*1024", save_dir=save_dir,
+ )
+ elapsed = time.time() - t0
+ if paths:
+ print(f"✓ 生成 {len(paths)} 张图片 ({elapsed:.1f}s): {paths}")
+ else:
+ print(f"✗ 返回空列表 ({elapsed:.1f}s)")
+ except Exception as e:
+ print(f"✗ 失败: {e}")
+ sys.exit(1)
+
+ # 图生图
+ print("\n=== 图生图测试 ===")
+ img_path = "code/result/image/test_avail/test_input.png"
+ prompt = "在这张图片的基础上,添加一些飞舞的樱花花瓣,绘制为水彩画风格"
+ for model in MODELS:
+ print(f"\nPrompt: {prompt}")
+ print(f"model: {model}")
+ os.makedirs(save_dir, exist_ok=True)
+ t0 = time.time()
+ try:
+ paths = client.edit_image(
+ prompt=prompt, image_urls=[img_path], model=model,
+ size="1024*1024", save_dir=save_dir,
)
elapsed = time.time() - t0
if paths:
diff --git a/aigc-director/aigc-claw/backend/tool/image_gpt.py b/aigc-director/aigc-claw/backend/tool/image_gpt.py
index 8648fb8..7ecf52a 100644
--- a/aigc-director/aigc-claw/backend/tool/image_gpt.py
+++ b/aigc-director/aigc-claw/backend/tool/image_gpt.py
@@ -46,6 +46,22 @@
self.max_attempts = 10
self.image_processor = ImageProcessor()
+ def _encode_image_to_base64(self, image_path: str) -> str:
+ """将本地图片转换为 Base64 编码"""
+ if not image_path or not os.path.exists(image_path):
+ return image_path
+
+ try:
+ with open(image_path, "rb") as f:
+ img_data = base64.b64encode(f.read()).decode("utf-8")
+ ext = os.path.splitext(image_path)[1].lower().replace(".", "")
+ if ext not in ["png", "jpg", "jpeg", "webp"]:
+ ext = "png"
+ return f"data:image/{ext};base64,{img_data}"
+ except Exception as e:
+ print(f"Error encoding image {image_path}: {e}")
+ return image_path
+
def generate_image(self, prompt, size="1024x1024", quality="high", model="gpt-image-2",
save_dir=None, image_urls=None):
"""Generate a single image, download it, and return the local file path.
@@ -61,6 +77,15 @@
attempts = 0
last_error = None
+
+ # 处理参考图片
+ extra_body = {}
+ if image_urls and isinstance(image_urls, list) and len(image_urls) > 0:
+ # 中转站通常支持通过 extra_body 传递 image_url 或 ref_image
+ # 这里我们将第一张图作为参考图
+ ref_images = [self._encode_image_to_base64(image_urls[i]) for i in range(min(len(image_urls), 6))]
+ extra_body = {"image_url": ref_images}
+
while attempts < self.max_attempts:
try:
response = self.client.images.generate(
@@ -68,20 +93,40 @@
prompt=prompt,
size=size,
quality=quality,
+ thinking=False,
n=1,
+ extra_body=extra_body
)
- if response and response.data and response.data[0].url:
- url = response.data[0].url
+
+ if not response or not response.data:
+ raise RuntimeError("OpenAI API 返回数据为空")
+
+ img_data = response.data[0]
+ file_path = None
+
+ # 1. 处理 Base64 格式 (中转站常用)
+ if hasattr(img_data, 'b64_json') and img_data.b64_json:
if save_dir:
os.makedirs(save_dir, exist_ok=True)
- file_name = f"sora_{int(time.time())}_{uuid.uuid4().hex[:6]}.png"
+ file_name = f"gpt_{int(time.time())}_{uuid.uuid4().hex[:6]}.png"
+ file_path = os.path.join(save_dir, file_name)
+ with open(file_path, "wb") as f:
+ f.write(base64.b64decode(img_data.b64_json))
+ return file_path
+ return img_data.b64_json
+
+ # 2. 处理 URL 格式
+ elif hasattr(img_data, 'url') and img_data.url:
+ url = img_data.url
+ if save_dir:
+ os.makedirs(save_dir, exist_ok=True)
+ file_name = f"gpt_{int(time.time())}_{uuid.uuid4().hex[:6]}.png"
file_path = os.path.join(save_dir, file_name)
if self.image_processor.download_image(url, file_path):
return file_path
- else:
- print(f"Failed to save image from {url}")
- else:
return url
+
+ raise RuntimeError("未在响应中找到 url 或 b64_json")
except Exception as e:
last_error = e
msg = str(e)
@@ -107,21 +152,22 @@
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from config import Config
- print("=== GPT 图片生成可用性测试 ===")
+ MODELS = ["gpt-image-2"]
+ save_dir = "code/result/image/test_avail"
api_key = Config.OPENAI_API_KEY
base_url = Config.OPENAI_BASE_URL
-
- MODELS = ["gpt-image-2.0"]
- img_prompt = "A cute orange cat lying on a sunny windowsill, watercolor style"
- img_path = ""
-
if not api_key:
print("✗ OPENAI_API_KEY 未设置,跳过")
sys.exit(1)
-
+ print("=== GPT 图片生成测试 ===")
print(f" API Key: {api_key[:6]}***")
print(f" Base URL: {base_url}")
+
+ # 文生图
+ print("\n=== GPT 文生图可用性测试 ===")
+ img_prompt = "A cute orange cat lying on a sunny windowsill, watercolor style"
+ img_path = ""
client = ImageGPT(api_key=api_key, base_url=Config.OPENAI_BASE_URL, local_proxy=Config.LOCAL_PROXY)
for model in MODELS:
print(f"\nTesting model: {model}")
@@ -129,7 +175,6 @@
print(f"Image path: {img_path}")
client.max_attempts = 1
t0 = time.time()
- save_dir = "result/image/test_avail"
os.makedirs(save_dir, exist_ok=True)
try:
path = client.generate_image(prompt=img_prompt, size="1024x1024",
@@ -139,3 +184,23 @@
except Exception as e:
elapsed = time.time() - t0
print(f"✗ 失败 ({elapsed:.1f}s): {e}")
+
+ # 图生图
+ print("\n=== GPT 图生图可用性测试 ===")
+ img_prompt = "Turn this cat into a cute cartoon character with big eyes and a playful expression"
+ img_path = "code/result/image/test_avail/test_input.jpg"
+ for model in MODELS:
+ print(f"\nTesting model: {model}")
+ print(f"Prompt: {img_prompt}")
+ print(f"Image path: {img_path}")
+ client.max_attempts = 1
+ t0 = time.time()
+ os.makedirs(save_dir, exist_ok=True)
+ try:
+ path = client.generate_image(prompt=img_prompt, size="1024x1024",
+ model=model, save_dir=save_dir, image_urls=[img_path])
+ elapsed = time.time() - t0
+ print(f"✓ 生成成功 ({elapsed:.1f}s): {path}")
+ except Exception as e:
+ elapsed = time.time() - t0
+ print(f"✗ 失败 ({elapsed:.1f}s): {e}")
\ No newline at end of file
diff --git a/aigc-director/aigc-claw/backend/tool/llm_deepseek.py b/aigc-director/aigc-claw/backend/tool/llm_deepseek.py
index 34b34e2..8304c1a 100644
--- a/aigc-director/aigc-claw/backend/tool/llm_deepseek.py
+++ b/aigc-director/aigc-claw/backend/tool/llm_deepseek.py
@@ -6,6 +6,8 @@
"""
deepseek-chat: DeepSeek-V3.2 非思考模式
deepseek-reasoner: DeepSeek-V3.2 思考模式
+ deepseek-v4-flash: DeepSeek-V4 Flash
+ deepseek-v4-pro: DeepSeek-V4 Pro
"""
def __init__(self, base_url="", api_key=""):
self.base_url = base_url or os.getenv("DEEPSEEK_BASE_URL") or "https://api.deepseek.com/v1"
@@ -67,10 +69,10 @@
from config import Config
# 支持的模型列表
- MODELS = ["deepseek-chat", "deepseek-reasoner"]
+ MODELS = ["deepseek-chat", "deepseek-reasoner", "deepseek-v4-flash", "deepseek-v4-pro"]
print("=== DeepSeek 可用性测试 ===")
- api_key = os.getenv("DEEPSEEK_API_KEY", "")
+ api_key = os.getenv("DEEPSEEK_API_KEY")
base_url = os.getenv("DEEPSEEK_BASE_URL", "")
if not api_key:
print("✗ DEEPSEEK_API_KEY 未设置,跳过")
diff --git a/aigc-director/aigc-claw/backend/tool/video_seedance.py b/aigc-director/aigc-claw/backend/tool/video_seedance.py
index f604606..3a0dbd1 100644
--- a/aigc-director/aigc-claw/backend/tool/video_seedance.py
+++ b/aigc-director/aigc-claw/backend/tool/video_seedance.py
@@ -1,6 +1,6 @@
"""
Seedance 视频生成 API 客户端 (字节跳动 ARK)
-支持 doubao-seedance-2-0-260128 模型
+
"""
import os
@@ -173,7 +173,7 @@
IMAGE_PATH = "code/result/image/test_avail/test_input.png"
OUTPUT_PATH = "code/result/video/test_avail/seedance_test_output.mp4"
PROMPT = ""
- MODEL = "doubao-seedance-2-0-260128"
+ MODELS = ["doubao-seedance-2-0-fast-260128", "doubao-seedance-2-0-260128"]
DURATION = 5
print("=== Seedance (ARK) 图生视频测试 ===")
@@ -190,32 +190,35 @@
print(f" API Key : {api_key[:6]}***{api_key[-4:]}")
print(f" Base URL : {base_url}")
- print(f" 输入图片 : {IMAGE_PATH}")
- print(f" 输出路径 : {OUTPUT_PATH}")
- print(f" 模型 : {MODEL}")
- print(f" 时长 : {DURATION}s")
- if PROMPT:
- print(f" 提示词 : {PROMPT[:80]}")
- print("-" * 40)
- try:
- client = SeedanceVideoClient(api_key=api_key, base_url=base_url)
- print("✓ 客户端初始化成功")
+ for model in MODELS:
+ print("\n" + "="*40)
+ print(f" 输入图片 : {IMAGE_PATH}")
+ print(f" 输出路径 : {OUTPUT_PATH}")
+ print(f" 模型 : {model}")
+ print(f" 时长 : {DURATION}s")
+ if PROMPT:
+ print(f" 提示词 : {PROMPT[:80]}")
- start = time.time()
- video_url = client.generate_video(
- prompt=PROMPT,
- image_path=IMAGE_PATH,
- save_path=OUTPUT_PATH,
- model=MODEL,
- duration=DURATION,
- )
- elapsed = time.time() - start
+ try:
+ client = SeedanceVideoClient(api_key=api_key, base_url=base_url)
+ print("✓ 客户端初始化成功")
- print(f"✓ 视频生成完成!耗时 {elapsed:.1f}s")
- print(f" 远端 URL : {video_url}")
- print(f" 本地文件 : {os.path.abspath(OUTPUT_PATH)}")
- print(f" 文件大小 : {os.path.getsize(OUTPUT_PATH) / 1024 / 1024:.2f} MB")
- except Exception as e:
- print(f"✗ 失败: {e}")
- sys.exit(1)
+ start = time.time()
+ video_url = client.generate_video(
+ prompt=PROMPT,
+ image_path=IMAGE_PATH,
+ save_path=OUTPUT_PATH,
+ model=model,
+ duration=DURATION,
+ )
+ elapsed = time.time() - start
+
+ print(f"✓ 视频生成完成!耗时 {elapsed:.1f}s")
+ print(f" 远端 URL : {video_url}")
+ print(f" 本地文件 : {os.path.abspath(OUTPUT_PATH)}")
+ print(f" 文件大小 : {os.path.getsize(OUTPUT_PATH) / 1024 / 1024:.2f} MB")
+ except Exception as e:
+ print(f"✗ 失败: {e}")
+ sys.exit(1)
+ break # 只测试第一个模型
diff --git a/aigc-director/aigc-claw/frontend/components/HomePage.tsx b/aigc-director/aigc-claw/frontend/components/HomePage.tsx
index 83d2704..115432b 100644
--- a/aigc-director/aigc-claw/frontend/components/HomePage.tsx
+++ b/aigc-director/aigc-claw/frontend/components/HomePage.tsx
@@ -57,11 +57,11 @@
const [idea, setIdea] = useState('');
const [showSettings, setShowSettings] = useState(false);
const [selectedStyle, setSelectedStyle] = useState('realistic');
- const [selectedLLM, setSelectedLLM] = useState(LLM_MODELS[0].id);
- const [selectedVLM, setSelectedVLM] = useState(VLM_MODELS[0].id);
- const [selectedT2I, setSelectedT2I] = useState(T2I_MODELS[0].id);
- const [selectedI2I, setSelectedI2I] = useState(I2I_MODELS[0].id);
- const [selectedVideo, setSelectedVideo] = useState(VIDEO_MODELS[0].id);
+ const [selectedLLM, setSelectedLLM] = useState(LLM_MODELS.find(m => m.default)?.id || LLM_MODELS[0].id);
+ const [selectedVLM, setSelectedVLM] = useState(VLM_MODELS.find(m => m.default)?.id || VLM_MODELS[0].id);
+ const [selectedT2I, setSelectedT2I] = useState(T2I_MODELS.find(m => m.default)?.id || T2I_MODELS[0].id);
+ const [selectedI2I, setSelectedI2I] = useState(I2I_MODELS.find(m => m.default)?.id || I2I_MODELS[0].id);
+ const [selectedVideo, setSelectedVideo] = useState(VIDEO_MODELS.find(m => m.default)?.id || VIDEO_MODELS[0].id);
const [selectedRatio, setSelectedRatio] = useState('16:9');
const [enableConcurrency, setEnableConcurrency] = useState(true);
const [webSearch, setWebSearch] = useState(false);
diff --git a/aigc-director/aigc-claw/frontend/components/Sandbox/Sandbox.tsx b/aigc-director/aigc-claw/frontend/components/Sandbox/Sandbox.tsx
index e70836d..15f3edb 100644
--- a/aigc-director/aigc-claw/frontend/components/Sandbox/Sandbox.tsx
+++ b/aigc-director/aigc-claw/frontend/components/Sandbox/Sandbox.tsx
@@ -313,7 +313,7 @@
}
};
- const [selectedModel, setSelectedModel] = useState(getModels()[0]?.id || '');
+ const [selectedModel, setSelectedModel] = useState(getModels().find(m => m.default)?.id || getModels()[0]?.id || '');
const [webSearch, setWebSearch] = useState(false);
// 工具切换时重置模型选择
@@ -330,7 +330,7 @@
default: return LLM_MODELS;
}
})();
- setSelectedModel(models[0]?.id || '');
+ setSelectedModel(models.find(m => m.default)?.id || models[0]?.id || '');
setResult(null);
setError(null);
setImageUrl('');
@@ -351,7 +351,7 @@
// 只有当前模型不在新工具的模型列表中时才更新
const currentInList = models.some(m => m.id === selectedModel);
if (!currentInList) {
- setSelectedModel(models[0]?.id || '');
+ setSelectedModel(models.find(m => m.default)?.id || models[0]?.id || '');
}
}, [activeTool]);
diff --git a/aigc-director/aigc-claw/frontend/config/models.ts b/aigc-director/aigc-claw/frontend/config/models.ts
index d4d93fa..fd51a73 100644
--- a/aigc-director/aigc-claw/frontend/config/models.ts
+++ b/aigc-director/aigc-claw/frontend/config/models.ts
@@ -29,6 +29,8 @@
models: [
{ id: 'deepseek-chat', label: 'deepseek-chat' },
{ id: 'deepseek-reasoner', label: 'deepseek-reasoner' },
+ { id: 'deepseek-v4-flash', label: 'deepseek-v4-flash' },
+ { id: 'deepseek-v4-pro', label: 'deepseek-v4-pro' },
],
},
{
@@ -59,7 +61,9 @@
provider: 'dashscope',
label: 'DashScope',
models: [
- { id: 'wan2.6-t2i', label: 'wan2.6-t2i', default: true },
+ { id: 'wan2.7-image', label: 'wan2.7-image', default: true },
+ { id: 'wan2.7-image-pro', label: 'wan2.7-image-pro' },
+ { id: 'wan2.6-t2i', label: 'wan2.6-t2i' },
],
},
{
@@ -82,7 +86,6 @@
provider: 'openai',
label: 'OpenAI',
models: [
- { id: 'sora_image', label: 'sora_image' },
{ id: 'gpt-image-2', label: 'gpt-image-2' },
],
},
@@ -96,7 +99,8 @@
provider: 'dashscope',
label: 'DashScope',
models: [
- { id: 'wan2.6-t2i', label: 'wan2.6-t2i', default: true },
+ { id: 'wan2.7-image', label: 'wan2.7-image', default: true },
+ { id: 'wan2.7-image-pro', label: 'wan2.7-image-pro' },
],
},
{
@@ -141,6 +145,7 @@
label: 'Seedance',
models: [
{ id: 'doubao-seedance-2-0-260128', label: 'Seedance 2.0' },
+ { id: 'doubao-seedance-2-0-fast-260128', label: 'Seedance 2.0 Fast' },
],
},
{
diff --git a/aigc-director/references/sandbox/generate_image_t2i.md b/aigc-director/references/sandbox/generate_image_t2i.md
index 5db9e15..ce71c54 100644
--- a/aigc-director/references/sandbox/generate_image_t2i.md
+++ b/aigc-director/references/sandbox/generate_image_t2i.md
@@ -8,7 +8,7 @@
curl -X POST "http://localhost:8000/api/sandbox/t2i" \
-H "Content-Type: application/json" \
-d '{
- "model": "doubao-seedream-5-0",
+ "model": "wan2.7-image",
"prompt": "A cute cat sitting on a couch, realistic style"
}'
```
@@ -17,9 +17,11 @@
| 模型 | 说明 |
|------|------|
-| doubao-seedream-5-0 | 默认 |
-| gpt-image-2 | OpenAI 最新模型 |
+| wan2.7-image | 默认 |
+| wan2.7-image-pro | |
| wan2.6-t2i | |
+| doubao-seedream-5-0 | |
+| gpt-image-2 | OpenAI 最新模型 |
| sora_image | |
## 响应
--
Gitblit v1.8.0