diff --git a/src/templates/n8nTemplates/CosplayRealPersonTemplate.ts b/src/templates/n8nTemplates/CosplayRealPersonTemplate.ts new file mode 100644 index 0000000..c35b7da --- /dev/null +++ b/src/templates/n8nTemplates/CosplayRealPersonTemplate.ts @@ -0,0 +1,23 @@ +import { N8nVideoGenerateTemplate } from '../n8nTemplate'; + +// cos真人模板 +export class CosplayRealPersonTemplate extends N8nVideoGenerateTemplate { + readonly code = 'cosplay_real_person_v1'; + readonly name = 'cos真人'; + readonly description = '生成cosplay这张插图的真人照片,背景设置在Comiket,并生成cosplay人物做经典动作的视频'; + readonly creditCost = 25; + readonly version = '1.0.0'; + readonly input = 'https://cdn.roasmax.cn/upload/c69a847f8e8740f594f731ef502c4054.png'; // 原始插图示例 + readonly output = 'https://file.302.ai/gpt/imgs/20250903/376c2ee8e6bc06598b34cc43ce649aae.jpg'; // 输出图片示例 + readonly tags = ['cosplay', '真人', 'Comiket', '动漫', '二次元', '视频生成']; + + // N8n模板特定属性 - 图片生成 + readonly imageModel = 'gemini-2.5-flash-image'; // 根据要求使用 gemini-2.5-flash-image + readonly imagePrompt = '生成一张cosplay这张插图的照片,背景设置在Comiket,插图主体大一些'; + + // N8n模板特定属性 - 视频生成 + readonly videoModel = '302/MiniMax-Hailuo-02'; + readonly videoPrompt = '图片里的cosplay人物动起来,做出这个cosplay人物的经典动作'; + readonly duration = 6; // 6秒视频 + readonly aspectRatio = '9:16'; // 竖屏比例 +} diff --git a/src/templates/n8nTemplates/index.ts b/src/templates/n8nTemplates/index.ts index e2e62e7..9cdaf32 100644 --- a/src/templates/n8nTemplates/index.ts +++ b/src/templates/n8nTemplates/index.ts @@ -1,2 +1,3 @@ export * from './PhotoRestoreTemplate'; -export * from './close-eyes.template'; \ No newline at end of file +export * from './close-eyes.template'; +export * from './CosplayRealPersonTemplate'; \ No newline at end of file diff --git a/src/templates/template.service.ts b/src/templates/template.service.ts index 6529881..6efb249 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 } from './n8nTemplates'; +import { CloseEyesTemplate, PhotoRestoreTemplate, CosplayRealPersonTemplate } from './n8nTemplates'; @Injectable() export class TemplateService implements OnModuleInit { @@ -72,6 +72,7 @@ export class TemplateService implements OnModuleInit { this.templateManager.registerTemplates([ new PhotoRestoreTemplate(), new CloseEyesTemplate(), + new CosplayRealPersonTemplate(), ]); } catch (error) { this.logger.error('模板初始化失败:', error);