Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
text2video-frontend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周成波
text2video-frontend
Commits
7e15b57b
Commit
7e15b57b
authored
Mar 12, 2024
by
周成波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加营销模板
parent
5c019015
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
366 additions
and
9 deletions
+366
-9
components.d.ts
components.d.ts
+1
-0
text2videoService.ts
src/api/service/text2videoService.ts
+20
-2
waiting.png
src/assets/waiting.png
+0
-0
utils.ts
src/utils/utils.ts
+1
-1
useManyValues.ts
src/views/home/compositions/useManyValues.ts
+43
-1
index.vue
src/views/home/index.vue
+288
-5
lib.wm.api.d.ts
typings/types/wm/lib.wm.api.d.ts
+13
-0
No files found.
components.d.ts
View file @
7e15b57b
...
...
@@ -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'
]
...
...
src/api/service/text2videoService.ts
View file @
7e15b57b
...
...
@@ -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
View replaced file @
5c019015
View file @
7e15b57b
1.02 KB
|
W:
|
H:
957 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
src/utils/utils.ts
View file @
7e15b57b
...
...
@@ -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)
...
...
src/views/home/compositions/useManyValues.ts
View file @
7e15b57b
...
...
@@ -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
,
}
}
src/views/home/index.vue
View file @
7e15b57b
This diff is collapsed.
Click to expand it.
typings/types/wm/lib.wm.api.d.ts
View file @
7e15b57b
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment