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
1423d428
Commit
1423d428
authored
Mar 05, 2024
by
周成波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug修复
parent
1f769e0a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
762 deletions
+22
-762
useManyValues.ts
src/views/home/compositions/useManyValues.ts
+1
-1
index--bak20240301.vue
src/views/home/index--bak20240301.vue
+0
-754
index.vue
src/views/home/index.vue
+19
-7
index_en.vue
src/views/home/index_en.vue
+1
-0
lib.wm.api.d.ts
typings/types/wm/lib.wm.api.d.ts
+1
-0
No files found.
src/views/home/compositions/useManyValues.ts
View file @
1423d428
...
...
@@ -67,7 +67,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
:
``
,
...
...
src/views/home/index--bak20240301.vue
deleted
100644 → 0
View file @
1f769e0a
This diff is collapsed.
Click to expand it.
src/views/home/index.vue
View file @
1423d428
...
...
@@ -210,6 +210,7 @@ const onAdapt = async () => {
"画面描述词"
:
""
,
"本镜配图"
:
"src/assets/waiting.png"
,
"local_image_path"
:
""
,
"info"
:
""
,
});
}
console
.
log
(
form
.
adapt_result_json
)
...
...
@@ -257,12 +258,13 @@ const onAdaptOneScene = async (item: any) => {
return
;
}
// 推理场景
// 人物(可以发挥想象进行补充,但一定要有), 暂时去掉
try
{
const
adapt_restrict
=
`故事:\n
${
form
.
chatgpt_answer
}
\n
指令:
请理解这个故事,给出这个场景“
${
item
.
场景描述
}
”的关键词(年代(可以发挥想象进行补充,但一定要有),空间(可以发挥想象进行补充,但一定要有),
时间段(可以发挥想象进行补充,但一定要有),地理环境(可以发挥想象进行补充,但一定要有),天气(可以发挥想象进行补充,但一定要有),
物品(可以发挥想象进行补充,但一定要有),
人物(可以发挥想象进行补充,但一定要有),
镜头角度(可以发挥想象进行补充,但一定要有))。
物品(可以发挥想象进行补充,但一定要有),镜头角度(可以发挥想象进行补充,但一定要有))。
要求:
关键词以逗号分隔。
只要返回关键词,不需要其他的说明文字。`
;
...
...
@@ -343,10 +345,12 @@ const onAdaptOneSceneRoles = async (item: any) => {
}
else
{
// 总角色不为空
// const adapt_role_restrict = `请理解这个故事:“${form.chatgpt_answer}”,针对其中的这个场景:“${item.场景描述}”,从所有角色:“${form.all_roles}”中选择本场景的角色,多个角色以逗号分隔。`;
const
adapt_role_restrict
=
`整个故事(“
${
form
.
chatgpt_answer
}
),\n\n本章节(
${
item
.
场景描述
}
),\n\n角色列表(
${
form
.
all_roles
}
),\n\n
你是程序员,请返回给本章节出现的角色,注意,
不要发挥想象,必须从角色列表中选出本章节出现过的角色,如果多个用逗号隔开。`
;
const
adapt_role_restrict
=
`整个故事(“
${
form
.
chatgpt_answer
}
),\n\n本章节(
${
item
.
场景描述
}
),\n\n角色列表(
${
form
.
all_roles
}
),\n\n
请返回给本章节出现的角色。注意:
不要发挥想象,必须从角色列表中选出本章节出现过的角色,如果多个用逗号隔开。`
;
const
item_roles
=
await
text2videoService
.
submitLLM
(
adapt_role_restrict
,
tuili_keyword_llm
.
api
);
console
.
log
(
`==============
${
item
.
编号
}
===============`
)
// console.log(adapt_role_restrict)
// console.log(item_roles)
console
.
log
(
`推理返回:
${
item_roles
}
`
)
item
.
info
=
`推理返回:
${
item_roles
}
`
item
.
角色
=
item_roles
.
trim
();
////// 加一段逻辑,本镜角色有且只能有一个,且尽量不与之前相同。【begin】
...
...
@@ -356,7 +360,13 @@ const onAdaptOneSceneRoles = async (item: any) => {
if
(
temp_arr_length
>
1
)
{
////// 获取本镜之前的所有角色
let
role_history
=
""
;
form
.
adapt_result_json
.
forEach
(
scene
=>
{
if
(
scene
.
编号
<
item
.
编号
)
{
role_history
+=
scene
.
角色
+
","
;
}
})
form
.
adapt_result_json
.
forEach
(
scene
=>
{
if
(
Number
(
scene
.
编号
)
<
Number
(
item
.
编号
))
{
role_history
+=
scene
.
角色
+
","
;
}
})
role_history
=
role_history
.
replace
(
/,+$/
,
''
);
console
.
log
(
`role_history =
${
role_history
}
`
)
for
(
const
temp
of
temp_arr
)
{
if
(
role_history
.
includes
(
temp
))
{
item
.
角色
=
""
;
...
...
@@ -366,7 +376,7 @@ const onAdaptOneSceneRoles = async (item: any) => {
break
;
}
}
if
(
item
.
角色
==
""
)
{
if
(
!
item
.
角色
)
{
const
role_history_arr
=
role_history
.
split
(
','
);
if
(
role_history_arr
.
length
>=
2
)
{
item
.
角色
=
role_history_arr
[
role_history_arr
.
length
-
2
];
...
...
@@ -375,8 +385,10 @@ const onAdaptOneSceneRoles = async (item: any) => {
}
else
{
item
.
角色
=
item_roles
.
trim
();
}
console
.
log
(
`lalalalala item.角色 =
${
item
.
角色
}
`
)
}
}
console
.
log
(
`item.角色 =
${
item
.
角色
}
`
)
////// 加一段逻辑,本镜角色有且只能有一个,且尽量不与之前相同。【end】
// 开始匹配角色关键词
...
...
@@ -776,9 +788,9 @@ const onDeleteOne = (item: any) => {
<el-text
class=
"mx-1"
size=
"small"
>
{{
scope
.
row
.
场景关键词英文
}}
</el-text>
</
template
>
</el-table-column>
<el-table-column
prop=
"角色"
label=
"角色"
width=
"150"
>
<el-table-column
prop=
"角色"
label=
"角色"
>
<
template
v-slot=
"scope"
>
<el-text
class=
"mx-1"
size=
"small"
>
{{
scope
.
row
.
角色
}}
</el-text>
<el-text
class=
"mx-1"
size=
"small"
>
{{
scope
.
row
.
角色
}}
<
br/>
(
{{
scope
.
row
.
info
}}
)
<
/el-text>
</
template
>
</el-table-column>
<el-table-column
prop=
"角色关键词"
label=
"角色关键词"
>
...
...
src/views/home/index_en.vue
View file @
1423d428
...
...
@@ -178,6 +178,7 @@ const onAdapt = async () => {
"画面描述词"
:
""
,
"本镜配图"
:
"src/assets/loading.gif"
,
"local_image_path"
:
""
,
"info"
:
""
,
});
}
console
.
log
(
form
.
adapt_result_json
)
...
...
typings/types/wm/lib.wm.api.d.ts
View file @
1423d428
...
...
@@ -10,6 +10,7 @@ declare namespace Wm {
"画面描述词"
:
string
,
"本镜配图"
:
string
,
"local_image_path"
:
string
,
"info"
:
string
,
}
interface
GenVideo
{
...
...
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