From f2f39fa8ba77c6dd454f2adc82e055db910424da Mon Sep 17 00:00:00 2001 From: imeepos Date: Wed, 3 Sep 2025 19:15:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=AE=A0=E7=89=A9?= =?UTF-8?q?=E6=89=8B=E5=8A=9E=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增PetFigurineTemplate模板类 - 模板代码: pet_figurine_v1 - 支持图生图+生视频功能 - 使用gemini-2.5-flash-image模型生成1/7比例宠物手办 - 使用302/MiniMax-Hailuo-02模型生成手办把玩视频 - 图片生成提示词: 创建商业化宠物手办,展示在电脑桌上 - 包含透明亚克力底座 - MacBook Pro屏幕显示ZBrush建模过程 - BANDAI风格包装盒展示原画 - 视频生成提示词: 一双手拿起手办展示把玩 - 积分消耗: 30分 - 视频时长: 6秒,竖屏比例9:16 - 更新模板导出和注册配置 - 提供完整的示例图片和视频链接 --- .../n8nTemplates/PetFigurineTemplate.ts | 23 +++++++++++++++++++ src/templates/n8nTemplates/index.ts | 3 ++- src/templates/template.service.ts | 3 ++- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/templates/n8nTemplates/PetFigurineTemplate.ts diff --git a/src/templates/n8nTemplates/PetFigurineTemplate.ts b/src/templates/n8nTemplates/PetFigurineTemplate.ts new file mode 100644 index 0000000..6ea0524 --- /dev/null +++ b/src/templates/n8nTemplates/PetFigurineTemplate.ts @@ -0,0 +1,23 @@ +import { N8nVideoGenerateTemplate } from '../n8nTemplate'; + +// 宠物手办模板 +export class PetFigurineTemplate extends N8nVideoGenerateTemplate { + readonly code = 'pet_figurine_v1'; + readonly name = '宠物手办'; + readonly description = '将宠物插图制作成1/7比例的商业化手办,展示在电脑桌上,并生成手办把玩视频'; + readonly creditCost = 30; + readonly version = '1.0.0'; + readonly input = 'https://cdn.roasmax.cn/upload/7cc18d70e9ba48bc8cadff7d3cdf62e1.png'; // 原始宠物插图示例 + readonly output = 'https://cdn.roasmax.cn/upload/02f5c251162043f28e9da8d984546f40.png'; // 输出手办图片示例 + readonly tags = ['宠物', '手办', '模型', '收藏', 'BANDAI', 'ZBrush', '视频生成']; + + // N8n模板特定属性 - 图片生成 + readonly imageModel = 'gemini-2.5-flash-image'; // nano banana 模型 + readonly imagePrompt = 'Create a 1/7 scale commercialized figure of the animal in the illustration, in a realistic style and environment. Place the figure on a computer desk, using a circular transparent acrylic base without any text. On the Macbook Pro screen, display the ZBrush modeling process of the figure in line mode. Next to the computer screen, place a BANDAI-style toy packaging box printed with the original artwork.'; + + // N8n模板特定属性 - 视频生成 + readonly videoModel = '302/MiniMax-Hailuo-02'; + readonly videoPrompt = '一双手拿起手办,在手里展示把玩'; + readonly duration = 6; // 6秒视频 + readonly aspectRatio = '9:16'; // 竖屏比例 +} diff --git a/src/templates/n8nTemplates/index.ts b/src/templates/n8nTemplates/index.ts index 9cdaf32..eeb46bd 100644 --- a/src/templates/n8nTemplates/index.ts +++ b/src/templates/n8nTemplates/index.ts @@ -1,3 +1,4 @@ export * from './PhotoRestoreTemplate'; export * from './close-eyes.template'; -export * from './CosplayRealPersonTemplate'; \ No newline at end of file +export * from './CosplayRealPersonTemplate'; +export * from './PetFigurineTemplate'; \ No newline at end of file diff --git a/src/templates/template.service.ts b/src/templates/template.service.ts index 6efb249..bd001ce 100644 --- a/src/templates/template.service.ts +++ b/src/templates/template.service.ts @@ -1,6 +1,6 @@ import { Injectable, OnModuleInit, Logger } from '@nestjs/common'; import { TemplateManager, Template } from './types'; -import { CloseEyesTemplate, PhotoRestoreTemplate, CosplayRealPersonTemplate } from './n8nTemplates'; +import { CloseEyesTemplate, PhotoRestoreTemplate, CosplayRealPersonTemplate, PetFigurineTemplate } from './n8nTemplates'; @Injectable() export class TemplateService implements OnModuleInit { @@ -73,6 +73,7 @@ export class TemplateService implements OnModuleInit { new PhotoRestoreTemplate(), new CloseEyesTemplate(), new CosplayRealPersonTemplate(), + new PetFigurineTemplate(), ]); } catch (error) { this.logger.error('模板初始化失败:', error);