From d08fecd5c58ed32811cac6512f0681c77008d997 Mon Sep 17 00:00:00 2001 From: imeepos Date: Wed, 3 Sep 2025 20:01:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=96=B0=E6=A8=A1=E6=9D=BF=20-=20=E8=BD=A6=E5=BA=93=E5=BC=80?= =?UTF-8?q?=E9=97=A8=E3=80=81=E4=BA=BA=E7=89=A9=E6=89=8B=E5=8A=9E=E3=80=81?= =?UTF-8?q?=E5=8E=9F=E5=AD=90=E5=BC=B9=E7=88=86=E7=82=B8=E3=80=81=E6=97=A5?= =?UTF-8?q?=E6=9C=AC=E6=9D=82=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增GarageOpeningTemplate模板类 - 模板代码: garage_opening_v1 - 豪宅车库开门场景,展示Lamborghini豪车 - 使用gemini-2.5-flash-image-preview和302/veo3-fast-frames - 16:9横屏视频,积分消耗35分 - 新增CharacterFigurineTemplate模板类 - 模板代码: character_figurine_v1 - 人物照片制作成精细角色手办模型 - PVC材质渲染,收藏家房间场景 - 积分消耗28分,包含抚摸手办视频 - 新增NuclearExplosionTemplate模板类 - 模板代码: nuclear_explosion_v1 - 远处核爆炸冲击波电影化场景 - 启示录风格特效视频 - 积分消耗20分 - 新增JapaneseMagazineTemplate模板类 - 模板代码: japanese_magazine_v1 - 日本杂志风格数字海报 - 使用mj模型,包含日语文本和拼贴元素 - 人物律动视频,积分消耗32分 - 更新模板导出和注册配置 - 提供完整的示例图片和视频链接 --- .../n8nTemplates/CharacterFigurineTemplate.ts | 23 +++++++++++++++++++ .../n8nTemplates/GarageOpeningTemplate.ts | 23 +++++++++++++++++++ .../n8nTemplates/JapaneseMagazineTemplate.ts | 23 +++++++++++++++++++ .../n8nTemplates/NuclearExplosionTemplate.ts | 23 +++++++++++++++++++ src/templates/n8nTemplates/index.ts | 6 ++++- src/templates/template.service.ts | 6 ++++- 6 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 src/templates/n8nTemplates/CharacterFigurineTemplate.ts create mode 100644 src/templates/n8nTemplates/GarageOpeningTemplate.ts create mode 100644 src/templates/n8nTemplates/JapaneseMagazineTemplate.ts create mode 100644 src/templates/n8nTemplates/NuclearExplosionTemplate.ts diff --git a/src/templates/n8nTemplates/CharacterFigurineTemplate.ts b/src/templates/n8nTemplates/CharacterFigurineTemplate.ts new file mode 100644 index 0000000..a4232b8 --- /dev/null +++ b/src/templates/n8nTemplates/CharacterFigurineTemplate.ts @@ -0,0 +1,23 @@ +import { N8nVideoGenerateTemplate } from '../n8nTemplate'; + +// 人物手办模板 +export class CharacterFigurineTemplate extends N8nVideoGenerateTemplate { + readonly code = 'character_figurine_v1'; + readonly name = '人物手办'; + readonly description = '将人物照片制作成精细的角色手办模型,展示在收藏家房间中,并生成抚摸手办的视频'; + readonly creditCost = 28; + readonly version = '1.0.0'; + readonly input = 'https://cdn.roasmax.cn/upload/3d590851eb584e92aa415a964e93260e.jpg'; // 原始人物照片示例 + readonly output = 'https://file.302.ai/gpt/imgs/20250828/2283106b31faf2066e1a72d955f65bca.jpg'; // 输出手办图片示例 + readonly tags = ['人物', '手办', '模型', '收藏', 'PVC', '角色模型', '视频生成']; + + // N8n模板特定属性 - 图片生成 + readonly imageModel = 'gemini-2.5-flash-image-preview'; // nano banana 模型 + readonly imagePrompt = 'Transform this photo into a highly detailed character model. Place a detailed, colorful box with the image of the character from the photo in front of the model. In front of the box, place the finished character model from the photo, with the PVC texture rendered realistically. Set the entire scene in a bright, stylish interior, reminiscent of a toy collector\'s or hobbyist\'s room—full of intricate details, vibrant decor, and a playful atmosphere. Ensure the lighting is bright and clear to highlight the model and its packaging.'; + + // N8n模板特定属性 - 视频生成 + readonly videoModel = '302/MiniMax-Hailuo-02'; + readonly videoPrompt = '一只手摸了摸手办的脑袋'; + readonly duration = 6; // 6秒视频 + readonly aspectRatio = '9:16'; // 竖屏比例 +} diff --git a/src/templates/n8nTemplates/GarageOpeningTemplate.ts b/src/templates/n8nTemplates/GarageOpeningTemplate.ts new file mode 100644 index 0000000..4342739 --- /dev/null +++ b/src/templates/n8nTemplates/GarageOpeningTemplate.ts @@ -0,0 +1,23 @@ +import { N8nVideoGenerateTemplate } from '../n8nTemplate'; + +// 车库开门模板 +export class GarageOpeningTemplate extends N8nVideoGenerateTemplate { + readonly code = 'garage_opening_v1'; + readonly name = '车库开门'; + readonly description = '生成豪宅车库开门场景,展示人物站在现代豪宅前,车库门缓缓升起露出豪车的视频'; + readonly creditCost = 35; + readonly version = '1.0.0'; + readonly input = 'https://bowong-ai-shanghai.tos-cn-shanghai.volces.com/images/1756889137996_jujhz5.jpg'; // 原始人物图片示例 + readonly output = 'https://cdn.roasmax.cn/upload/a0a299ffe4b14e07b034e3a45db20f79.png'; // 输出图片示例 + readonly tags = ['车库', '豪宅', '豪车', 'Lamborghini', '时尚', '奢华', '视频生成']; + + // N8n模板特定属性 - 图片生成 + readonly imageModel = 'gemini-2.5-flash-image-preview'; // nano banana 模型 + readonly imagePrompt = 'First shot, 4K still frame: A person with long straight black hair, facing camera, wearing a plain pastel-pink track jacket and matching full-length track pants, white crew socks, and clean pink sneakers. They stand on sun-lit marble in front of a closed matte-black garage door of a modern white mansion. Bright sunlight, palm trees on both sides, marble stairs on the right.'; + + // N8n模板特定属性 - 视频生成 + readonly videoModel = '302/veo3-fast-frames'; // 使用veo3-fast-frames模型 + readonly videoPrompt = 'Realistic 4K movie video clip: In front of a modern mansion garage with a large black curtain door. As the black rolling shutter door slowly rises (with a smooth and stable movement), the subject walks backwards in perfect sync (with a natural gait and eye contact with the door). Once the two Lamborghini Urus SUVs are fully exposed from the car doors—one in bright pink and the other in matte dark brown—the subject will stop in front of the cars and make a natural gesture (pointing to features, explaining, confident posture). At the last second of the video, the camera will focus on the subject and pull away a bit. Throughout the video, the camera steadily advances (focusing on the subject and cars at a slightly lower angle to enhance luxury), with bright sunlight illuminating the marble walls, palm trees on both sides of the entrance, and visible stairs on the right. This scene combines high-end fashion, luxurious atmosphere, and smooth motion transitions.'; + readonly duration = 6; // 6秒视频 + readonly aspectRatio = '16:9'; // veo3-fast-frames只支持16:9比例 +} diff --git a/src/templates/n8nTemplates/JapaneseMagazineTemplate.ts b/src/templates/n8nTemplates/JapaneseMagazineTemplate.ts new file mode 100644 index 0000000..76723e1 --- /dev/null +++ b/src/templates/n8nTemplates/JapaneseMagazineTemplate.ts @@ -0,0 +1,23 @@ +import { N8nVideoGenerateTemplate } from '../n8nTemplate'; + +// 日本杂志模板 +export class JapaneseMagazineTemplate extends N8nVideoGenerateTemplate { + readonly code = 'japanese_magazine_v1'; + readonly name = '日本杂志'; + readonly description = '生成时尚的日本杂志风格数字海报,包含多个模特和日语文本元素,并制作人物律动视频'; + readonly creditCost = 32; + readonly version = '1.0.0'; + readonly input = 'https://cdn.roasmax.cn/upload/1980dcb0b0e3467794065c85ba607913.jpg'; // 原始人物图片示例 + readonly output = 'https://file.302.ai/gpt/imgs/20250903/ade8425169c84ab599be132be0b6a119.jpg'; // 输出杂志图片示例 + readonly tags = ['日本杂志', '时尚', '海报', '街头服饰', '拼贴', '日语文本', '视频生成']; + + // N8n模板特定属性 - 图片生成 + readonly imageModel = 'mj'; // 使用 mj 模型 + readonly imagePrompt = '品牌活动的编辑风格数字海报,以时尚的中央女模特为特色,她只展示头部近景、分层的街头服饰和自信的眼神。她被大胆的灯光和拼贴风格的阴影所包围。在背景前方下面,微缩的另外的她人工智能生成的模型展示了俏皮、休闲的风格——一个穿着无檐便帽和牛仔夹克,另一个穿着柔和的运动服,手势富有表现力。该场景使用纯白色的工作室背景,充满了剪纸贴纸、星星、箭头和粗体日语文本,并配以彩色轮廓。具有大胆的布局和优雅的排版。'; + + // N8n模板特定属性 - 视频生成 + readonly videoModel = '302/MiniMax-Hailuo-02'; + readonly videoPrompt = '这张图片的人物都在自己的位置不变,但是都要欢快的小幅度的律动'; + readonly duration = 6; // 6秒视频 + readonly aspectRatio = '9:16'; // 竖屏比例 +} diff --git a/src/templates/n8nTemplates/NuclearExplosionTemplate.ts b/src/templates/n8nTemplates/NuclearExplosionTemplate.ts new file mode 100644 index 0000000..60ed193 --- /dev/null +++ b/src/templates/n8nTemplates/NuclearExplosionTemplate.ts @@ -0,0 +1,23 @@ +import { N8nVideoGenerateTemplate } from '../n8nTemplate'; + +// 原子弹爆炸模板 +export class NuclearExplosionTemplate extends N8nVideoGenerateTemplate { + readonly code = 'nuclear_explosion_v1'; + readonly name = '原子弹爆炸'; + readonly description = '生成远处核爆炸场景,冲击波向人物吹来的电影化启示录风格视频'; + readonly creditCost = 20; + readonly version = '1.0.0'; + readonly input = 'https://cdn.roasmax.cn/upload/1980dcb0b0e3467794065c85ba607913.jpg'; // 原始人物图片示例 + readonly output = 'https://file.302.ai/gpt/imgs/20250903/4f4fbdff8c3343858f897685013b4a24.mp4'; // 输出视频示例 + readonly tags = ['核爆炸', '冲击波', '启示录', '电影化', '特效', '视频生成']; + + // N8n模板特定属性 - 图片生成(这个模板主要用于视频生成,图片生成使用原图) + readonly imageModel = 'gemini-2.5-flash-image-preview'; // nano banana 模型 + readonly imagePrompt = 'Keep the original image unchanged, prepare for nuclear explosion video generation'; + + // 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 2896cec..857c8f4 100644 --- a/src/templates/n8nTemplates/index.ts +++ b/src/templates/n8nTemplates/index.ts @@ -2,4 +2,8 @@ export * from './PhotoRestoreTemplate'; export * from './close-eyes.template'; export * from './CosplayRealPersonTemplate'; export * from './PetFigurineTemplate'; -export * from './open-eyes.template' \ No newline at end of file +export * from './open-eyes.template'; +export * from './GarageOpeningTemplate'; +export * from './CharacterFigurineTemplate'; +export * from './NuclearExplosionTemplate'; +export * from './JapaneseMagazineTemplate'; \ No newline at end of file diff --git a/src/templates/template.service.ts b/src/templates/template.service.ts index eb8e45e..a81d7fb 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 { OpenEyesTemplate, PhotoRestoreTemplate, CosplayRealPersonTemplate, PetFigurineTemplate } from './n8nTemplates'; +import { OpenEyesTemplate, PhotoRestoreTemplate, CosplayRealPersonTemplate, PetFigurineTemplate, GarageOpeningTemplate, CharacterFigurineTemplate, NuclearExplosionTemplate, JapaneseMagazineTemplate } from './n8nTemplates'; @Injectable() export class TemplateService implements OnModuleInit { @@ -74,6 +74,10 @@ export class TemplateService implements OnModuleInit { new OpenEyesTemplate(), new CosplayRealPersonTemplate(), new PetFigurineTemplate(), + new GarageOpeningTemplate(), + new CharacterFigurineTemplate(), + new NuclearExplosionTemplate(), + new JapaneseMagazineTemplate(), ]); } catch (error) { this.logger.error('模板初始化失败:', error);