Commit 7e15b57b authored by 周成波's avatar 周成波

增加营销模板

parent 5c019015
......@@ -13,6 +13,7 @@ declare module 'vue' {
ElDivider: typeof import('element-plus/es')['ElDivider']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
......
......@@ -4,11 +4,11 @@
import request from '@/api/request'
export default {
submitLLM(prompt: string, llm: string = "gpt"): Promise<string> {
submitLLM(prompt: string, llm: string = "gpt", history: Wm.PromptHistory[] = []): Promise<string> {
if (!prompt) {
return Promise.reject("输入不能为空");
}
const post_data = { source_text: prompt, llm: llm }
const post_data = { source_text: prompt, history: history, llm: llm }
return request.post('/text2video/text2llm', post_data)
.then((res: any) => {
// console.log(res);
......@@ -130,4 +130,22 @@ export default {
return Promise.reject(`与翻译接口通讯失败:${JSON.stringify(err.message)}`);
});
},
submitAddTextToImg(param: any): Promise<{"domain_image_path": string, "local_image_path": string}> {
const post_data = param
return request.post('/text2video/add_text_to_img', post_data)
.then((res: any) => {
// console.log(res);
if (res && res.code === 0) {
return {"domain_image_path": res.data.result.domain_image_path, "local_image_path": res.data.result.local_image_path};
} else {
const errorMessage = res ? res.message : "未知错误";
return Promise.reject(errorMessage);
}
})
.catch((err: any) => {
console.log(`err = ${JSON.stringify(err)}`);
return Promise.reject(`add_text_to_img接口通讯失败:${JSON.stringify(err.message)}`);
});
},
}
src/assets/waiting.png

1.02 KB | W: | H:

src/assets/waiting.png

957 Bytes | W: | H:

src/assets/waiting.png
src/assets/waiting.png
src/assets/waiting.png
src/assets/waiting.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -36,7 +36,7 @@ export default class utils {
static splitText(str: string) {
str = str.replaceAll('“','').replaceAll('”','')
// 使用正则表达式拆分文本
let sentences = str.split(/[!|?|。]/);
let sentences = str.split(/[!|?|。|"|!]/);
// 过滤掉长度为 0 的句子
sentences = sentences.filter(s => s.length > 0);
// console.log(sentences)
......
......@@ -69,7 +69,7 @@ export const useManyValues = () => {
const vertical_data = {
task_id: "20240220181602687",
chatgpt_prompt: `生成一个50字的科幻小故事,阿凡达系列`,
chatgpt_answer: `在宁静的森林里。一场奇特的食物大战正在上演。一只机灵的小松鼠。眼尖地发现了一块香气扑鼻的奶油蛋糕,正惬意地躺在熊猫阿宝的竹篮里。蛋糕上的水果点缀和醇厚的奶油似乎在向小松鼠招手,它的口水都快流成一条小溪了。`,
chatgpt_answer: `在宁静的森林里。一场奇特的食物大战正在上演。`,
chatgpt_answer_roles: [],
adapt_result_json: [],
final_video: ``,
......@@ -262,6 +262,47 @@ export const useManyValues = () => {
sd_prompt_prefix: sd_prompt_prefix + ", <lora:sdxl_lightning_8step_lora:0.2>",
},
};
const marketing_template = {
product_name: "金巧蒂原味猪肉松",
product_description:
`1. 酥而不腻,入口即化
2. 原料主要采用新鲜猪后腿肉,经过水域立即处理,加上老师傅祖传的配方,结合现代化的生产工艺,锤炼出柔软酥松,绵而不腻,味香可口的“猪肉松”,并全程使用“多力牌”葵花油
3. 选用天然万家香酱油
4. 选用蒂纳海盐
5. 猪肉松的主要营养成分有碳水化合物、脂肪、蛋白质和多种矿物质,胆固醇含量低,且易于人体消化吸收,具有很高的营养价值。但是要注意一点,猪肉松不能与鹌鹑肉同食,吃多容易生黑斑哦
6. 我们“金巧蒂”的产品,确保是在屠宰后2小时内进行加工,绝对锁住肉质口感不流失。猪肉肉质细腻且营养价值丰富,对人体有极高的营养价值及保健作用,如长期食用可延年益寿,并有着汤汁浓郁,绕齿留香的特点`,
target_people: "20-30岁年轻女生",
text_role: "小松鼠",
text_style: "幽默",
story_type: "科幻",
reference: "猪八戒娶媳妇儿的情节",
words_num: 100,
result1: "",
result2: "",
if_need_product_pic: "false",
product_pic: "http://wm-tools-backend.frp.wmdigit.com:8888/assets/2024/03/06/4784edb2-db68-11ee-a7de-9be5c7a16c02_resized.jpg",
product_pic_local: "assets/2024/03/06/4784edb2-db68-11ee-a7de-9be5c7a16c02_resized.jpg",
product_pic_with_text: "http://wm-tools-backend.frp.wmdigit.com:8888/assets/2024/03/06/4784edb2-db68-11ee-a7de-9be5c7a16c02_resized_with_text.jpg",
product_pic_with_text_local: "assets/2024/03/06/4784edb2-db68-11ee-a7de-9be5c7a16c02_resized_with_text.jpg",
product_pic_titles: [
{
text: "金巧蒂原味猪肉松",
color: "#FB7D01",
bg_color: "",
font_size: 45,
position: 0.8,
},
{
text: "促销价只要8.8!快来抢购吧~",
color: "#FF0800",
bg_color: "",
font_size: 45,
position: 0.2,
},
],
product_pic_speech: "我们的产品正在促销热卖中,点点关注哦~",
};
return {
screen: screen,
......@@ -281,5 +322,6 @@ export const useManyValues = () => {
bgm_volume_marks: bgm_volume_marks,
role_attribute_options: role_attribute_options,
sd_paras: sd_paras,
marketing_template: marketing_template,
}
}
This diff is collapsed.
......@@ -4,6 +4,19 @@ declare namespace Wm {
"height": string,
}
interface PromptHistory {
"role": string,
"content": string,
}
interface PicText {
"text": string,
"color": string,
"bg_color": string,
"font_size": number,
"position": number,
}
interface ScriptsItem {
"编号": string,
"场景描述": string,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment