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
10610901
Commit
10610901
authored
Feb 26, 2024
by
周成波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
fb5edeea
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
+12
-10
loading.gif
src/assets/loading.gif
+0
-0
index.vue
src/views/home/index.vue
+12
-10
No files found.
src/assets/loading.gif
0 → 100644
View file @
10610901
114 KB
src/views/home/index.vue
View file @
10610901
...
@@ -28,7 +28,7 @@ const form = reactive({
...
@@ -28,7 +28,7 @@ const form = reactive({
const
sd_prompt_prefix
=
default_data
.
sd_prompt_prefix
;
const
sd_prompt_prefix
=
default_data
.
sd_prompt_prefix
;
const
sd_negative_prompt_prefix
=
default_data
.
sd_negative_prompt_prefix
;
const
sd_negative_prompt_prefix
=
default_data
.
sd_negative_prompt_prefix
;
const
tyqw
=
{
'api'
:
'tyqw'
,
'name'
:
'通义千问'
};
const
tyqw
=
{
'api'
:
'tyqw'
,
'name'
:
'通义千问
线上
'
};
const
baichuan
=
{
'api'
:
'langchain'
,
'name'
:
'baichuan2-7b'
};
const
baichuan
=
{
'api'
:
'langchain'
,
'name'
:
'baichuan2-7b'
};
const
qwen
=
{
'api'
:
'langchain'
,
'name'
:
'Qwen-7B-Chat'
};
const
qwen
=
{
'api'
:
'langchain'
,
'name'
:
'Qwen-7B-Chat'
};
...
@@ -154,7 +154,7 @@ const onAdapt = async () => {
...
@@ -154,7 +154,7 @@ const onAdapt = async () => {
"角色"
:
""
,
"角色"
:
""
,
"角色关键词"
:
""
,
"角色关键词"
:
""
,
"画面描述词"
:
""
,
"画面描述词"
:
""
,
"本镜配图"
:
""
,
"本镜配图"
:
"
src/assets/loading.gif
"
,
"local_image_path"
:
""
,
"local_image_path"
:
""
,
});
});
}
}
...
@@ -163,8 +163,9 @@ const onAdapt = async () => {
...
@@ -163,8 +163,9 @@ const onAdapt = async () => {
async
function
processScenes
()
{
async
function
processScenes
()
{
for
(
const
item
of
form
.
adapt_result_json
)
{
for
(
const
item
of
form
.
adapt_result_json
)
{
await
onAdaptOne
(
item
);
await
onAdaptOne
(
item
);
await
delay
(
100
);
// await delay(100);
await
onDrawOne
(
item
);
// await onDrawOne(item);
onDrawOne
(
item
);
}
}
}
}
...
@@ -207,18 +208,17 @@ const onAdaptOne = async (item: any) => {
...
@@ -207,18 +208,17 @@ const onAdaptOne = async (item: any) => {
const
keywords
=
await
text2videoService
.
submitGpt
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_restrict
,
tuili_llm
);
const
keywords
=
await
text2videoService
.
submitGpt
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_restrict
,
tuili_llm
);
// console.log(keywords)
// console.log(keywords)
item
.
场景关键词
=
keywords
;
item
.
场景关键词
=
keywords
;
const
adapt_role_restrict
=
`
指令:
请理解这个故事,针对其中的这个场景:“
${
item
.
场景描述
}
”,从所有角色中选择本场景的角色,多个角色以逗号分隔。`
;
const
item_roles
=
await
text2videoService
.
submitGpt
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
所有角色:
\n
"
+
form
.
all_roles
+
"
\n
"
+
adapt_role_restrict
,
tuili_llm
);
// console.log(role_keywords)
if
(
form
.
chatgpt_answer_roles
.
length
===
0
)
{
if
(
form
.
chatgpt_answer_roles
.
length
===
0
)
{
// 总角色为空
// 总角色为空
item
.
角色
=
''
;
item
.
角色
=
''
;
item
.
角色关键词
=
''
;
item
.
角色关键词
=
''
;
}
else
{
}
else
{
// 总角色不为空
// 总角色不为空
const
adapt_role_restrict
=
`
指令:
请理解这个故事,针对其中的这个场景:“
${
item
.
场景描述
}
”,从所有角色中选择本场景的角色,多个角色以逗号分隔。`
;
const
item_roles
=
await
text2videoService
.
submitGpt
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
所有角色:
\n
"
+
form
.
all_roles
+
"
\n
"
+
adapt_role_restrict
,
tuili_llm
);
// console.log(role_keywords)
item
.
角色
=
item_roles
;
item
.
角色
=
item_roles
;
let
role_kws
=
""
let
role_kws
=
""
const
item_roles_arr
=
item_roles
.
split
(
/
[
,,
]
/
);
const
item_roles_arr
=
item_roles
.
split
(
/
[
,,
]
/
);
...
@@ -254,6 +254,7 @@ const onDrawOne = async (item: any) => {
...
@@ -254,6 +254,7 @@ const onDrawOne = async (item: any) => {
console
.
log
(
form
.
task_id
)
console
.
log
(
form
.
task_id
)
}
}
try
{
try
{
item
.
本镜配图
=
"src/assets/loading.gif"
;
let
temp_prompt
=
""
let
temp_prompt
=
""
if
(
item
.
场景描述
)
{
temp_prompt
=
temp_prompt
+
`场景描述为:
${
item
.
场景描述
}
\n`
};
if
(
item
.
场景描述
)
{
temp_prompt
=
temp_prompt
+
`场景描述为:
${
item
.
场景描述
}
\n`
};
if
(
item
.
场景关键词
)
{
temp_prompt
=
temp_prompt
+
`场景关键词为:
${
item
.
场景关键词
}
\n`
};
if
(
item
.
场景关键词
)
{
temp_prompt
=
temp_prompt
+
`场景关键词为:
${
item
.
场景关键词
}
\n`
};
...
@@ -286,6 +287,7 @@ const onDrawOne = async (item: any) => {
...
@@ -286,6 +287,7 @@ const onDrawOne = async (item: any) => {
message
:
String
(
error
),
message
:
String
(
error
),
type
:
"error"
,
type
:
"error"
,
});
});
item
.
本镜配图
=
""
}
}
};
};
...
...
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