Commit ebe46320 authored by 周成波's avatar 周成波

v20240203

parent 3b9c98ca
<script setup lang="ts">
import { onMounted, reactive, ref } from "vue";
import { ElMessage } from "element-plus";
import text2videoService from "@/api/service/text2videoService";
import utils from "@/utils/utils";
const loading = ref(false);
const form = reactive({
chatgpt_prompt: "帮我生成一个关于医生穿越到古代行侠仗义的故事,约200字左右",
chatgpt_answer:
"曾经的医生王强穿越回了古代,发现这个时代正值战乱时期。他觉得自己是时候行侠仗义,保护那些无辜受苦的人们了。王强在一个村庄里遇到了一个年轻的农民,叫李明。李明父母在战乱中被杀,他成了孤儿,并且被恶势力欺压。王强决定帮助李明。他教授李明一些基本的医术,并且帮助他恢复村庄的秩序。为了支援农民,王强到处奔走,为那些受伤的人们进行治疗。他在古代用现代医学知识,快速治愈了一些以前无法治愈的疾病。他趁机收集了一群志同道合的人,组建了一个抗击恶势力的义勇军。由于他的医术悉心教导,王强手下的队伍战斗力大增,并且开始挑战恶势力的统治。在战斗中,王强发现一支正义的侠盗团队正在保护受苦的人们。他决定与他们合作,将农民们和侠盗团队联合起来,共同对抗恶势力。最终,王强和他的队伍,还有侠盗团队成功地将恶势力赶出了村庄,恢复了和平。他们在古代留下了无穷的传奇,为人们带来了新的希望和幸福。医生王强也与李明成了好朋友,他们一起守护着村庄的和平与安宁。",
adapt_restrict: '',
adapt_result: {
"task_id": "20240131095112500",
"task_info": [
{
"scene_no": "1",
"scene_describe": "曾经的医生王强穿越回了古代,发现这个时代正值战乱时期。",
"scene_keyword": "古代,时空穿越,未知时间段,室内",
"characters": "王强",
"characters_keyword": "男性,中年,普通人装扮,短发,黑色,平静,站立",
"image_promt":
"Wang Qiang found himself standing in an unfamiliar room. The dimly lit interior had an ancient feel to it, with wooden beams and ornate decorations adorning the room. Wang Qiang, a middle-aged man dressed in ordinary clothes, was startled by his sudden transportation through time and space. Although a bit confused, he remained calm and composed. Standing in the room, he observed his surroundings, trying to figure out which era he had arrived in.",
"domain_image_path":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/1.png",
"local_image_path": "assets/outputs/20240131095112500/img/1.png",
},
{
"scene_no": "2",
"scene_describe": "他觉得自己是时候行侠仗义,保护那些无辜受苦的人们了。",
"scene_keyword": "古代,战乱时期,白天,村庄",
"characters": "王强,受苦的人们",
"characters_keyword": "男性,中年,普通人装扮,短发,黑色,平静,站立 - 众人,年轻,农民装扮,短发,黑色,悲伤,跪地",
"image_promt":
"Scene: War-torn VillageCharacters:Wang Qiang - Male, Middle-aged, Commoner attire, Short hair, Black, Calm, StandingLi Ming - Male, Young, Peasant attire, Short hair, Black, Sad, KneelingWang Qiang stands in the ruins of the war-torn village, observing the destruction surrounding him. The once peaceful village now lies in ruins, with burnt houses and debris scattered everywhere. It is daytime, and the sun casts a gloomy light on the desolate scene.Nearby, Li Ming is seen kneeling on the ground, his head bowed in sorrow. His worn-out farmer's clothes reflect the hardships he has endured. His face, covered in dirt and tears, reveals the deep sadness in his heart. His farm tools lie abandoned next to him, useless in the chaos of war.Wang Qiang remains calm, his eyes filled with determination as he surveys the devastation. Despite the turmoil and despair, he stands tall, his resilience evident. As a middle-aged man, he carries the weight of the village's hopes and dreams on his shoulders, fighting bravely to protect what is left.Meanwhile, Li Ming's youthful innocence and optimism have been shattered by the brutality of war. Kneeling on the ground, he clings onto the fading memories of the peaceful past. The loss and grief he feels are evident in his posture, his trembling hands clasped in prayer, as he seeks solace in a higher power.In this war-torn village, Wang Qiang and Li Ming represent the contrast between the resilience of experience and the vulnerability of youth. They stand as symbols of the collective struggle and resilience of the villagers, amidst the chaos and destruction brought upon by the ancient era of war.",
"domain_image_path":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/2.png",
"local_image_path": "assets/outputs/20240131095112500/img/2.png",
},
]
},
final_video: "",
});
const sd_prompt_prefix = `best quality,masterpiece,realistic,HDR,UHD,8K,best quality,highres,absurdres,realistic,masterpiece,
Highly detailed,extreme detail description,Professional,cinematic_lighting,ultra-fine painting,full body,
Vivid Colors,physically-based rendering,cinematic,`;
const sd_negative_prompt_prefix = `multiple breasts, (mutated hands and fingers:1.5 ), (long body :1.3),
(mutation, poorly drawn :1.2) , black-white, bad anatomy, liquid body, liquid tongue, disfigured,
malformed, mutated, anatomical nonsense, malformed hands, long neck, blurred,
lowers, bad proportions, bad shadow, uncoordinated body, unnatural body, fused breasts,
bad breasts, huge breasts, poorly drawn breasts, extra breasts, liquid breasts, heavy breasts, missing breasts,
huge haunch, huge thighs, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh,
disappearing calf, disappearing legs, fused ears, bad ears, poorly drawn ears, extra ears, liquid ears, heavy ears,
missing ears, fused animal ears, bad animal ears, poorly drawn animal ears, extra animal ears, liquid animal ears,
heavy animal ears, missing animal ears, text, ui, error, missing fingers, missing limb, fused fingers,
one hand with more than 5 fingers, one hand with less than 5 fingers, one hand with more than 5 digit,
one hand with less than 5 digit, extra digit, fewer digits, fused digit, missing digit, bad digit, liquid digit,
colorful tongue, black tongue, cropped, watermark, username, blurry, JPEG artifacts, signature, 3D, 3D game,
3D game scene, 3D character, malformed feet, extra feet, bad feet, poorly drawn feet, fused feet, missing feet,
extra shoes, bad shoes, fused shoes, more than two shoes, poorly drawn shoes, bad gloves, poorly drawn gloves,
fused gloves, bad cum, poorly drawn cum, fused cum, bad hairs, poorly drawn hairs, fused hairs, big muscles, ugly,
bad face, fused face, poorly drawn face, cloned face, big face, long face, bad eyes, fused eyes poorly drawn eyes,
extra eyes, malformed limbs, more than 2 nipples, missing nipples, different nipples, fused nipples, bad nipples,
poorly drawn nipples, black nipples, colorful nipples, gross proportions. short arm, (((missing arms))), missing thighs,
missing calf, missing legs, mutation, duplicate, morbid, mutilated, poorly drawn hands, more than 1 left hand,
more than 1 right hand, deformed, (blurry), disfigured, missing legs, extra arms, extra thighs, more than 2 thighs,
extra calf, fused calf, nsfw,logo,text,extra legs, bad knee, extra knee, more than 2 legs, bad tails, bad mouth,
fused mouth, poorly drawn mouth, bad tongue, tongue within mouth, too long tongue, black tongue, big mouth, cracked mouth,
bad mouth, dirty face, dirty teeth, dirty pantie, fused pantie, poorly drawn pantie, fused cloth, poorly drawn cloth, bad pantie,
yellow teeth, thick lips, bad cameltoe, colorful cameltoe, bad asshole, poorly drawn asshole, fused asshole, missing asshole,
bad anus, bad pussy, bad crotch, bad crotch seam, fused anus, fused pussy, fused anus, fused crotch, poorly drawn crotch,
fused seam, poorly drawn anus, poorly drawn pussy, poorly drawn crotch, poorly drawn crotch seam, bad thigh gap, missing thigh gap,
fused thigh gap, liquid thigh gap, poorly drawn thigh gap, poorly drawn anus, bad collarbone, fused collarbone, missing collarbone,
liquid collarbone, obesity, worst quality, low quality, normal quality, liquid tentacles, bad tentacles, poorly drawn tentacles,
split tentacles, fused tentacles, missing clit, bad clit, fused clit, colorful clit, black clit, liquid clit, QR code, bar code, censored,
safety panties, safety knickers, beard, furry ,pony, pubic hair, mosaic, excrement, faeces, shit, futa, testis,mutated hands and fingers,
deformed,bad anatomy,disfigured,poorly drawn face,lowres,mutated,extra limb,ugly,poorly drawn hands,missing limb,floating limbs,
disconnected limbs,malformed hands,out of focus,long neck,long body,gape,`;
onMounted(() => { });
const onSubmitGpt = () => {
text2videoService
.submitGpt(form.chatgpt_prompt)
.then((result: string) => {
// console.log(result);
form.chatgpt_answer = result;
})
.catch((error: any) => {
// console.error(error);
ElMessage({
message: error,
type: "error",
});
});
};
const onAdapt = async () => {
if (!form.chatgpt_answer) {
ElMessage({
message: "内容不能为空",
type: "error",
});
return;
}
loading.value = true;
const task_id = utils.genDateTimeStr();
form.adapt_result.task_id = task_id;
// 分镜
const sentences = utils.splitText(form.chatgpt_answer);
form.adapt_result.task_info = []
for (let i = 0; i < sentences.length; i++) {
form.adapt_result.task_info.push({
scene_no: (i + 1).toString(),
scene_describe: sentences[i],
scene_keyword: "",
characters: "",
characters_keyword: "",
image_promt: "",
domain_image_path: "",
local_image_path: "",
});
if (i == 2){
break;
}
}
console.log(form.adapt_result)
// 循环处理每个分镜:生成关键字、翻译、绘图
const taskPromises = form.adapt_result.task_info.map(async (item) => {
// 生成关键字
try {
const adapt_restrict = `以上是一个短视频故事,请理解整个故事,以及本镜头“${item.scene_describe}”的内容,给出:场景(年代,空间,时间段,地理环境,天气,物品,人物,镜头角度)、角色、角色关键词(性别,年龄,肤色,衣服,发型,发色,脸色,五官特点,体态,情绪,肢体动作)。`;
const scene_describe = await text2videoService.submitGpt(form.chatgpt_answer + "\n" + adapt_restrict);
item.scene_keyword = scene_describe;
const sd_describe = await text2videoService.submitGpt(`${scene_describe}\n请将以上内容翻译为英文,结果必须全部为英文,不允许包含中文。`);
item.image_promt = sd_describe;
const sd_prompt = item.image_promt + "," + sd_prompt_prefix;
const sd_img = await text2videoService.submitSD(task_id, item.scene_no, sd_prompt, sd_negative_prompt_prefix);
item.domain_image_path = sd_img.domain_image_path;
console.log(form.adapt_result)
} catch (error) {
ElMessage({
message: String(error),
type: "error",
});
return {
scene_keyword: "",
characters: "",
characters_keyword: "",
};
}
});
};
const onDrawOne = (idxStr: string) => {
const idx = parseInt(idxStr) - 1;
// const task_id = form.ai_draw_json.task_id;
// // console.log(task_id)
// const newResult = form.ai_draw_json.task_info[idx].画面描述词;
// const sd_prompt = newResult + "," + sd_prompt_prefix;
// text2videoService
// .submitSD(task_id, idxStr, sd_prompt, sd_negative_prompt_prefix)
// .then((result: string) => {
// // console.log(result);
// form.ai_draw_json.task_info[idx].本镜配图 = "";
// form.ai_draw_json.task_info[idx].本镜配图 = result;
// })
// .catch((error: any) => {
// // console.error(error);
// ElMessage({
// message: error,
// type: "error",
// });
// });
};
// const onGenVideo = () => {
// // ElMessage({
// // message: "开发中",
// // type: "error",
// // });
// // return;
// const video_param_items = form.ai_draw_json.task_info.map(item => {
// return {
// idx: item.编号,
// text: item.场景描述,
// img_path: item.本镜配图
// };
// });
// const video_param = {
// task_id: form.ai_draw_json.task_id,
// task_info: video_param_items
// }
// console.log(video_param)
// text2videoService
// .submitGenVideo(video_param)
// .then((result: string) => {
// // console.log(result);
// form.final_video = result;
// })
// .catch((error: any) => {
// // console.error(error);
// ElMessage({
// message: error,
// type: "error",
// });
// });
// };
</script>
<template>
<main class="home-container">
<!-- 标题 -->
<el-divider content-position="left">text2video</el-divider>
<el-form :model="form" label-width="114px">
<!-- 小说到文案 -->
<el-form-item label="小说">
<el-input v-model="form.chatgpt_prompt" :autosize="true" type="textarea" placeholder="输入小说" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmitGpt">提交chatgpt,生成文案</el-button>
</el-form-item>
<el-form-item label="文案">
<el-input v-model="form.chatgpt_answer" :autosize="true" type="textarea" />
</el-form-item>
<!-- 文案到分镜 -->
<el-form-item label="分镜要求">
<el-input v-model="form.adapt_restrict" :autosize="true" type="textarea" placeholder="" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onAdapt">提交chatgpt,生成分镜</el-button>
</el-form-item>
<el-form-item label="分镜">
<el-table :data="form.adapt_result.task_info" border style="width: 100%; z-index: calc(var(--el-table-index) -1)">
<el-table-column prop="scene_no" label="编号" width="60" />
<el-table-column prop="scene_describe" label="场景描述">
<template v-slot="scope">
<el-input v-model="scope.row.scene_describe" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="scene_keyword" label="场景关键词">
<template v-slot="scope">
<el-input v-model="scope.row.scene_keyword" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="image_promt" label="画面描述词">
<template v-slot="scope">
<el-input v-model="scope.row.image_promt" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="domain_image_path" label="本镜配图">
<template v-slot="scope">
<div>
<el-image :src="scope.row.domain_image_path" :zoom-rate="1.2" :max-scale="1.5" :min-scale="0.5"
:preview-src-list="[scope.row.domain_image_path]" fit="cover" :hide-on-click-modal="true" />
</div>
</template>
</el-table-column>
<el-table-column width="100" label="操作">
<template v-slot="scope">
<el-button type="primary" size="small" @click="onDrawOne(scope.row.scene_no)">重绘本镜</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
</main>
</template>
<style lang="scss" scoped>
.home-container {
width: 100%;
}
</style>
<style lang="scss">
.home-container {
.el-table .el-table__cell {
z-index: calc(var(--el-table-index) -1);
}
}
</style>
<script setup lang="ts">
import { onMounted, reactive, ref } from "vue";
import { Sunny, UploadFilled } from "@element-plus/icons-vue";
import { ElMessage, ElLoading } from "element-plus";
import text2videoService from "@/api/service/text2videoService";
import utils from "@/utils/utils";
const loading = ref(false);
const step = ref(1);
const is_adapt_result_json = ref(1);
const form = reactive({
chatgpt_prompt: "帮我生成一个关于医生穿越到古代行侠仗义的故事,约200字左右",
chatgpt_answer:
"曾经的医生王强穿越回了古代,发现这个时代正值战乱时期。他觉得自己是时候行侠仗义,保护那些无辜受苦的人们了。王强在一个村庄里遇到了一个年轻的农民,叫李明。李明父母在战乱中被杀,他成了孤儿,并且被恶势力欺压。王强决定帮助李明。他教授李明一些基本的医术,并且帮助他恢复村庄的秩序。为了支援农民,王强到处奔走,为那些受伤的人们进行治疗。他在古代用现代医学知识,快速治愈了一些以前无法治愈的疾病。他趁机收集了一群志同道合的人,组建了一个抗击恶势力的义勇军。由于他的医术悉心教导,王强手下的队伍战斗力大增,并且开始挑战恶势力的统治。在战斗中,王强发现一支正义的侠盗团队正在保护受苦的人们。他决定与他们合作,将农民们和侠盗团队联合起来,共同对抗恶势力。最终,王强和他的队伍,还有侠盗团队成功地将恶势力赶出了村庄,恢复了和平。他们在古代留下了无穷的传奇,为人们带来了新的希望和幸福。医生王强也与李明成了好朋友,他们一起守护着村庄的和平与安宁。",
adapt_restrict:
'将上述文案改编为10个短视频分镜,给出每个分镜的场景描述、场景关键词(年代,空间,时间段,地理环境,天气,物品,人物,镜头角度)、角色、角色关键词(性别,年龄,肤色,衣服,发型,发色,脸色,五官特点,体态,情绪,肢体动作)。以如下json字符串的格式返回:{"分镜":[{"编号":"","场景描述":"","场景关键词":"","角色":"","角色关键词":""},...]}',
adapt_result: "",
adapt_result_json: {
"task_id": "20240131095112500",
"task_info": [
{
"scene_no": "1",
"scene_describe": "曾经的医生王强穿越回了古代,发现这个时代正值战乱时期。",
"scene_keyword": "古代,时空穿越,未知时间段,室内",
"characters": "王强",
"characters_keyword": "男性,中年,普通人装扮,短发,黑色,平静,站立",
"image_promt":
"Wang Qiang found himself standing in an unfamiliar room. The dimly lit interior had an ancient feel to it, with wooden beams and ornate decorations adorning the room. Wang Qiang, a middle-aged man dressed in ordinary clothes, was startled by his sudden transportation through time and space. Although a bit confused, he remained calm and composed. Standing in the room, he observed his surroundings, trying to figure out which era he had arrived in.",
"domain_image_path":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/1.png",
"local_image_path": "assets/outputs/20240131095112500/img/1.png",
},
{
"scene_no": "2",
"scene_describe": "他觉得自己是时候行侠仗义,保护那些无辜受苦的人们了。",
"scene_keyword": "古代,战乱时期,白天,村庄",
"characters": "王强,受苦的人们",
"characters_keyword": "男性,中年,普通人装扮,短发,黑色,平静,站立 - 众人,年轻,农民装扮,短发,黑色,悲伤,跪地",
"image_promt":
"Scene: War-torn VillageCharacters:Wang Qiang - Male, Middle-aged, Commoner attire, Short hair, Black, Calm, StandingLi Ming - Male, Young, Peasant attire, Short hair, Black, Sad, KneelingWang Qiang stands in the ruins of the war-torn village, observing the destruction surrounding him. The once peaceful village now lies in ruins, with burnt houses and debris scattered everywhere. It is daytime, and the sun casts a gloomy light on the desolate scene.Nearby, Li Ming is seen kneeling on the ground, his head bowed in sorrow. His worn-out farmer's clothes reflect the hardships he has endured. His face, covered in dirt and tears, reveals the deep sadness in his heart. His farm tools lie abandoned next to him, useless in the chaos of war.Wang Qiang remains calm, his eyes filled with determination as he surveys the devastation. Despite the turmoil and despair, he stands tall, his resilience evident. As a middle-aged man, he carries the weight of the village's hopes and dreams on his shoulders, fighting bravely to protect what is left.Meanwhile, Li Ming's youthful innocence and optimism have been shattered by the brutality of war. Kneeling on the ground, he clings onto the fading memories of the peaceful past. The loss and grief he feels are evident in his posture, his trembling hands clasped in prayer, as he seeks solace in a higher power.In this war-torn village, Wang Qiang and Li Ming represent the contrast between the resilience of experience and the vulnerability of youth. They stand as symbols of the collective struggle and resilience of the villagers, amidst the chaos and destruction brought upon by the ancient era of war.",
"domain_image_path":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/2.png",
"local_image_path": "assets/outputs/20240131095112500/img/2.png",
},
]
},
final_video: "",
});
const sd_prompt_prefix = `best quality,masterpiece,realistic,HDR,UHD,8K,best quality,highres,absurdres,realistic,masterpiece,
Highly detailed,extreme detail description,Professional,cinematic_lighting,ultra-fine painting,full body,
Vivid Colors,physically-based rendering,cinematic,`;
const sd_negative_prompt_prefix = `multiple breasts, (mutated hands and fingers:1.5 ), (long body :1.3),
(mutation, poorly drawn :1.2) , black-white, bad anatomy, liquid body, liquid tongue, disfigured,
malformed, mutated, anatomical nonsense, malformed hands, long neck, blurred,
lowers, bad proportions, bad shadow, uncoordinated body, unnatural body, fused breasts,
bad breasts, huge breasts, poorly drawn breasts, extra breasts, liquid breasts, heavy breasts, missing breasts,
huge haunch, huge thighs, huge calf, bad hands, fused hand, missing hand, disappearing arms, disappearing thigh,
disappearing calf, disappearing legs, fused ears, bad ears, poorly drawn ears, extra ears, liquid ears, heavy ears,
missing ears, fused animal ears, bad animal ears, poorly drawn animal ears, extra animal ears, liquid animal ears,
heavy animal ears, missing animal ears, text, ui, error, missing fingers, missing limb, fused fingers,
one hand with more than 5 fingers, one hand with less than 5 fingers, one hand with more than 5 digit,
one hand with less than 5 digit, extra digit, fewer digits, fused digit, missing digit, bad digit, liquid digit,
colorful tongue, black tongue, cropped, watermark, username, blurry, JPEG artifacts, signature, 3D, 3D game,
3D game scene, 3D character, malformed feet, extra feet, bad feet, poorly drawn feet, fused feet, missing feet,
extra shoes, bad shoes, fused shoes, more than two shoes, poorly drawn shoes, bad gloves, poorly drawn gloves,
fused gloves, bad cum, poorly drawn cum, fused cum, bad hairs, poorly drawn hairs, fused hairs, big muscles, ugly,
bad face, fused face, poorly drawn face, cloned face, big face, long face, bad eyes, fused eyes poorly drawn eyes,
extra eyes, malformed limbs, more than 2 nipples, missing nipples, different nipples, fused nipples, bad nipples,
poorly drawn nipples, black nipples, colorful nipples, gross proportions. short arm, (((missing arms))), missing thighs,
missing calf, missing legs, mutation, duplicate, morbid, mutilated, poorly drawn hands, more than 1 left hand,
more than 1 right hand, deformed, (blurry), disfigured, missing legs, extra arms, extra thighs, more than 2 thighs,
extra calf, fused calf, nsfw,logo,text,extra legs, bad knee, extra knee, more than 2 legs, bad tails, bad mouth,
fused mouth, poorly drawn mouth, bad tongue, tongue within mouth, too long tongue, black tongue, big mouth, cracked mouth,
bad mouth, dirty face, dirty teeth, dirty pantie, fused pantie, poorly drawn pantie, fused cloth, poorly drawn cloth, bad pantie,
yellow teeth, thick lips, bad cameltoe, colorful cameltoe, bad asshole, poorly drawn asshole, fused asshole, missing asshole,
bad anus, bad pussy, bad crotch, bad crotch seam, fused anus, fused pussy, fused anus, fused crotch, poorly drawn crotch,
fused seam, poorly drawn anus, poorly drawn pussy, poorly drawn crotch, poorly drawn crotch seam, bad thigh gap, missing thigh gap,
fused thigh gap, liquid thigh gap, poorly drawn thigh gap, poorly drawn anus, bad collarbone, fused collarbone, missing collarbone,
liquid collarbone, obesity, worst quality, low quality, normal quality, liquid tentacles, bad tentacles, poorly drawn tentacles,
split tentacles, fused tentacles, missing clit, bad clit, fused clit, colorful clit, black clit, liquid clit, QR code, bar code, censored,
safety panties, safety knickers, beard, furry ,pony, pubic hair, mosaic, excrement, faeces, shit, futa, testis,mutated hands and fingers,
deformed,bad anatomy,disfigured,poorly drawn face,lowres,mutated,extra limb,ugly,poorly drawn hands,missing limb,floating limbs,
disconnected limbs,malformed hands,out of focus,long neck,long body,gape,`;
onMounted(() => { });
const onSubmitGpt = () => {
text2videoService
.submitGpt(form.chatgpt_prompt)
.then((result: string) => {
// console.log(result);
form.chatgpt_answer = result;
})
.catch((error: any) => {
// console.error(error);
ElMessage({
message: error,
type: "error",
});
});
};
const onAdapt = async () => {
if (!form.chatgpt_answer) {
ElMessage({
message: "内容不能为空",
type: "error",
});
return;
}
loading.value = true;
const task_id = utils.genDateTimeStr();
form.adapt_result_json.task_id = task_id;
// 开始分镜
text2videoService
.submitGpt(form.chatgpt_answer + "\n" + form.adapt_restrict)
.then(async (result: string) => {
console.log(result);
try {
const scene_result = utils.formatJsonObj(result).分镜
form.adapt_result_json.task_info = scene_result.map((item: any) => {
return {
scene_no: item.编号,
scene_describe: item.场景描述,
scene_keyword: item.场景关键词,
characters: item.角色,
characters_keyword: item.角色关键词,
};
});
// 分镜结束,开始逐个绘图
const taskPromises = form.adapt_result_json.task_info.map(async (item) => {
// 翻译英文场景
try {
const result = await text2videoService.submitGpt(
`场景描述为:${item.scene_describe}\n场景关键词为:${item.scene_keyword}\n场景中的角色有:${item.characters}\n角色关键词为:${item.characters_keyword}\n
请理解以上内容,并翻译为相应的英文场景,返回结果不允许有中文。`
);
// const newResult = result.replaceAll(".", "").replaceAll('"', "");
const newResult = result
// 提交SD绘图
try {
const sd_prompt = newResult + "," + sd_prompt_prefix;
const sd_result = await text2videoService.submitSD(
task_id,
item.scene_no,
sd_prompt,
sd_negative_prompt_prefix
);
return {
scene_no: item.scene_no,
image_promt: newResult,
domain_image_path: sd_result.domain_image_path,
local_image_path: sd_result.local_image_path,
};
} catch (error) {
ElMessage({
message: String(error),
type: "error",
});
return {
scene_no: item.scene_no,
image_promt: newResult,
domain_image_path: "",
local_image_path: "",
};
}
} catch (error) {
ElMessage({
message: String(error),
type: "error",
});
return {
scene_no: item.scene_no,
image_promt: "",
domain_image_path: "",
local_image_path: "",
};
}
});
// 所有请求都返回后,重新排序
try {
const results = await Promise.all(taskPromises);
form.adapt_result_json.task_info = results.sort((a, b) => parseInt(a.scene_no) - parseInt(b.scene_no));
console.log(form.adapt_result_json);
} catch (error) {
// 处理错误
ElMessage({
message: String(error),
type: "error",
});
}
} catch (error) {
form.adapt_result = result;
is_adapt_result_json.value = 0;
} finally {
// 最终关闭loading(无论成功或失败)
loading.value = false;
}
})
.catch((error: any) => {
console.error(error);
ElMessage({
message: error,
type: "error",
});
});
};
const onDrawOne = (idxStr: string) => {
const idx = parseInt(idxStr) - 1;
// const task_id = form.ai_draw_json.task_id;
// // console.log(task_id)
// const newResult = form.ai_draw_json.task_info[idx].画面描述词;
// const sd_prompt = newResult + "," + sd_prompt_prefix;
// text2videoService
// .submitSD(task_id, idxStr, sd_prompt, sd_negative_prompt_prefix)
// .then((result: string) => {
// // console.log(result);
// form.ai_draw_json.task_info[idx].本镜配图 = "";
// form.ai_draw_json.task_info[idx].本镜配图 = result;
// })
// .catch((error: any) => {
// // console.error(error);
// ElMessage({
// message: error,
// type: "error",
// });
// });
};
// const onGenVideo = () => {
// // ElMessage({
// // message: "开发中",
// // type: "error",
// // });
// // return;
// const video_param_items = form.ai_draw_json.task_info.map(item => {
// return {
// idx: item.编号,
// text: item.场景描述,
// img_path: item.本镜配图
// };
// });
// const video_param = {
// task_id: form.ai_draw_json.task_id,
// task_info: video_param_items
// }
// console.log(video_param)
// text2videoService
// .submitGenVideo(video_param)
// .then((result: string) => {
// // console.log(result);
// form.final_video = result;
// })
// .catch((error: any) => {
// // console.error(error);
// ElMessage({
// message: error,
// type: "error",
// });
// });
// };
</script>
<template>
<main class="home-container">
<!-- 标题 -->
<el-divider content-position="left">text2video</el-divider>
<el-form :model="form" label-width="114px">
<!-- 小说到文案 -->
<el-form-item label="小说">
<el-input v-model="form.chatgpt_prompt" :autosize="true" type="textarea" placeholder="输入小说" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmitGpt">提交chatgpt,生成文案</el-button>
</el-form-item>
<el-form-item label="文案">
<el-input v-model="form.chatgpt_answer" :autosize="true" type="textarea" />
</el-form-item>
<!-- 文案到分镜 -->
<el-form-item label="分镜要求">
<el-input v-model="form.adapt_restrict" :autosize="true" type="textarea" placeholder="" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onAdapt">提交chatgpt,生成分镜</el-button>
</el-form-item>
<el-form-item label="分镜" v-if="is_adapt_result_json === 0">
<el-input v-model="form.adapt_result" :autosize="true" type="textarea" />
</el-form-item>
<el-form-item label="分镜" v-if="is_adapt_result_json === 1">
<el-table :data="form.adapt_result_json.task_info" border style="width: 100%; z-index: calc(var(--el-table-index) -1)">
<el-table-column prop="scene_no" label="编号" width="60" />
<el-table-column prop="scene_describe" label="场景描述">
<template v-slot="scope">
<el-input v-model="scope.row.scene_describe" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="scene_keyword" label="场景关键词">
<template v-slot="scope">
<el-input v-model="scope.row.scene_keyword" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="characters" label="角色">
<template v-slot="scope">
<el-input v-model="scope.row.characters" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="characters_keyword" label="角色关键词">
<template v-slot="scope">
<el-input v-model="scope.row.characters_keyword" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="image_promt" label="画面描述词">
<template v-slot="scope">
<el-input v-model="scope.row.image_promt" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="domain_image_path" label="本镜配图">
<template v-slot="scope">
<div>
<el-image :src="scope.row.domain_image_path" :zoom-rate="1.2" :max-scale="1.5" :min-scale="0.5"
:preview-src-list="[scope.row.domain_image_path]" fit="cover" :hide-on-click-modal="true" />
</div>
</template>
</el-table-column>
<el-table-column width="100" label="操作">
<template v-slot="scope">
<el-button type="primary" size="small" @click="onDrawOne(scope.row.scene_no)">重绘本镜</el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-form>
</main>
</template>
<style lang="scss" scoped>
.home-container {
width: 100%;
}
</style>
<style lang="scss">
.home-container {
.el-table .el-table__cell {
z-index: calc(var(--el-table-index) -1);
}
}
</style>
......@@ -6,194 +6,168 @@ import text2videoService from "@/api/service/text2videoService";
import utils from "@/utils/utils";
const loading = ref(false);
const step = ref(1);
const is_adapt_result_json = ref(1);
const form = reactive({
task_id: "20240131095112500",
chatgpt_prompt: "帮我生成一个关于医生穿越到古代行侠仗义的故事,约200字左右",
chatgpt_prompt: "帮我生成一个在丧尸横行的末世中,一个特种兵大杀四方,最后成为新世界的王,拥有无数女人的爽文故事,约200字左右",
chatgpt_answer:
"曾经的医生王强穿越回了古代,发现这个时代正值战乱时期。他觉得自己是时候行侠仗义,保护那些无辜受苦的人们了。王强在一个村庄里遇到了一个年轻的农民,叫李明。李明父母在战乱中被杀,他成了孤儿,并且被恶势力欺压。王强决定帮助李明。他教授李明一些基本的医术,并且帮助他恢复村庄的秩序。为了支援农民,王强到处奔走,为那些受伤的人们进行治疗。他在古代用现代医学知识,快速治愈了一些以前无法治愈的疾病。他趁机收集了一群志同道合的人,组建了一个抗击恶势力的义勇军。由于他的医术悉心教导,王强手下的队伍战斗力大增,并且开始挑战恶势力的统治。在战斗中,王强发现一支正义的侠盗团队正在保护受苦的人们。他决定与他们合作,将农民们和侠盗团队联合起来,共同对抗恶势力。最终,王强和他的队伍,还有侠盗团队成功地将恶势力赶出了村庄,恢复了和平。他们在古代留下了无穷的传奇,为人们带来了新的希望和幸福。医生王强也与李明成了好朋友,他们一起守护着村庄的和平与安宁。",
adapt_restrict: '将上述文案改编为10个短视频分镜,给出每个分镜的场景描述、场景关键词(年代,空间,时间段,地理环境,天气,物品,人物,镜头角度)、角色、角色关键词(性别,年龄,肤色,衣服,发型,发色,脸色,五官特点,体态,情绪,肢体动作)。以如下json字符串的格式返回:{"分镜":[{"编号":"","场景描述":"","场景关键词":"","角色":"","角色关键词":""},...]}',
adapt_result: "",
`在丧尸横行的末世中,特种兵杨轩犹如一道闪电,横扫四方。他身负着研制的特殊型丧尸武器,每次出击都是血雨腥风。杨轩的勇猛无畏深深震撼了其他幸存者,他们纷纷投靠于他的旗下。 逐渐地,杨轩建立起一座摇摇欲坠的王城“无敌之城”,成为了希望的象征。他带领着军队与丧尸们战斗,一次次逆袭,最终统一了丧尸肆虐的土地。 在这个新世界,杨轩成为了王者,摄政了数万女人的心。他英勇无敌的战绩和无私的领导才能令女人们痴迷。杨轩学会了爱护她们,温情细腻地照顾着每一个人。他们被他的坚毅与温柔深深吸引,陶醉在他的怀抱中。 然而,杨轩却不为无尽的女人所动,因为他深爱着一个人——那是他在丧尸横行时遇见的纯真灵魂。她是唯一敢与他争论,却又唯一能让他动心的存在。 杨轩的故事成为了末世传说,他的王朝将永远被世人传颂。他用自己的力量创造了新的世界,不再有恐惧和黑暗,取而代之的是和平与繁荣。 这是一个故事,关于一个特种兵,杀戮如潮,却为了寻找爱情而战斗。他成为了新世界的王,但他最终明白,真正让他心驰神往的不是权势与财富,而是那个平凡而温暖的女孩。`,
// adapt_result_json: <Wm.ScriptsItem[]>[],
adapt_result_json: [
{
"编号": "1",
"场景描述": "王强穿越回古代",
"场景关键词": "古代,时空穿越,未知时间段,室内",
"角色": "王强",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,平静,站立"
"场景描述": "在丧尸横行的末世中,特种兵杨轩犹如一道闪电,横扫四方",
"场景关键词": "\"丧尸横行的末世,特种兵,闪电,横扫四方\"",
"角色": "\"杨轩\"",
"角色关键词": "\"男性,成年,肤色不明,军装,短发,黑色,紧绷,坚毅,战斗力强,决绝,迅猛的动作\"",
"画面描述词": "In a post-apocalyptic world where zombies roam freely, special forces soldier Yang Xuan is like a lightning bolt, sweeping through all directions. Keywords: - Post-apocalyptic world with zombies - Special forces soldier - Lightning bolt - Sweeping all directions Character: - Yang Xuan Character Keywords: - Male - Adult - Unknown skin color - Military uniform - Short hair - Black - Tightly stretched - Strong fighting ability - Resolute - Swift and fierce movements Translation: In a world devastated by zombies, special forces soldier Yang Xuan, with his lightning-fast speed, fearlessly eliminates the undead in every direction.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/1.png?v=20240203010751462",
"local_image_path": "assets/outputs/20240203010153059/img/1.png"
},
{
"编号": "2",
"场景描述": "战乱的村庄",
"场景关键词": "古代,战乱时期,白天,村庄",
"角色": "王强,李明",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,平静,站立 - 男性,年轻,农民装扮,短发,黑色,悲伤,跪地"
"场景描述": "他身负着研制的特殊型丧尸武器,每次出击都是血雨腥风",
"场景关键词": "\"丧尸横行末世,特殊型丧尸武器,血雨腥风\"",
"角色": "\"特种兵杨轩\"",
"角色关键词": "\"男性,年轻,白肤色,军装,短发,黑色发色,坚毅,勇猛,无畏,深情,威猛的体态\"",
"画面描述词": "The scene depicts a world overrun by zombies, with the protagonist, Special Forces soldier Yang Xuan, carrying a special type of zombie weapon. Every time he goes into battle, it is a scene of bloodshed and violence. Scene keywords: \"Zombies roaming in a post-apocalyptic world, special type of zombie weapon, bloodshed and violence\" Character: \"Yang Xuan, a young male with fair skin, dressed in military uniform, short black hair, determined, brave, fearless, with a strong and heroic physique\" Translation: He carries a special type of zombie weapon he developed, and every time he goes into battle, it is a scene of bloodshed and violence. Keywords: \"Zombies roaming in a post-apocalyptic world, special type of zombie weapon, bloodshed and violence\" The character is Special Forces soldier Yang Xuan, a young male with fair skin, dressed in a military uniform. He has short black hair and a determined, brave, and fearless demeanor. He possesses a strong and heroic physique.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/2.png?v=20240203010818568",
"local_image_path": "assets/outputs/20240203010153059/img/2.png"
},
{
"编号": "3",
"场景描述": "王强教授李明医术",
"场景关键词": "古代,村庄内部,白天,室内",
"角色": "王强,李明",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,自信,坐下 - 男性,年轻,农民装扮,短发,黑色,专注,坐下"
"场景描述": "杨轩的勇猛无畏深深震撼了其他幸存者,他们纷纷投靠于他的旗下",
"场景关键词": "\"丧尸横行的末世,血雨腥风,幸存者投靠\"",
"角色": "\"特种兵杨轩,其他幸存者\"",
"角色关键词": "\"特种兵,勇猛无畏,其他幸存者,被震撼\"",
"画面描述词": "Description: Yang Xuan's fearless and courageous actions deeply shocked the other survivors, and they all flocked to join him. Keywords: \"zombie-infested apocalypse, bloodshed and gore, survivors flocking\" Characters: \"Special Forces soldier Yang Xuan, other survivors\" Character keywords: \"Special Forces, fearless and courageous, other survivors, being shocked\" Translation: The fearless and courageous actions of Special Forces soldier Yang Xuan deeply impressed the other survivors, who were living in a zombie-infested apocalypse. They were overwhelmed by the bloodshed and gore around them, and they decided to join Yang Xuan in his mission to survive and fight against the zombies.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/3.png?v=20240203010733553",
"local_image_path": "assets/outputs/20240203010153059/img/3.png"
},
{
"编号": "4",
"场景描述": "恢复村庄秩序",
"场景关键词": "古代,村庄外部,白天,室外",
"角色": "王强,李明,村民",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,自信,站立 - 男性,年轻,农民装扮,短发,黑色,专注,站立 - 男性,女性,各年龄段,普通人装扮,长发/短发,不同颜色,平静,站立/坐下"
"场景描述": " 逐渐地,杨轩建立起一座摇摇欲坠的王城“无敌之城”,成为了希望的象征",
"场景关键词": "\"末世, 摇摇欲坠的王城, 希望的象征\"",
"角色": "\"杨轩\"",
"角色关键词": "\"男性, 成年, 眼神坚毅, 意志坚定\"",
"画面描述词": "Gradually, Yang Xuan erected a crumbling king's city known as \"Invincible City\" in the post-apocalyptic world, becoming a symbol of hope. Scene keywords: \"post-apocalyptic, crumbling king's city, symbol of hope\" Character: \"Yang Xuan\" Character keywords: \"male, adult, determined gaze, resolute will\" Please understand the above content and translate it into English accordingly. Translation: Slowly but surely, Yang Xuan constructed a deteriorating royal city known as the \"City of Invincibility\" amidst the post-apocalyptic setting, becoming a definitive symbol of hope. Scene keywords: \"post-apocalyptic, deteriorating royal city, symbol of hope\" Character: \"Yang Xuan\" Character keywords: \"male, adult, unwavering gaze, firm determination\"",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/4.png?v=20240203010724581",
"local_image_path": "assets/outputs/20240203010153059/img/4.png"
},
{
"编号": "5",
"场景描述": "王强为受伤的人治疗",
"场景关键词": "古代,村庄内部,白天,室内",
"角色": "王强,伤者",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,专业,坐下 - 男性/女性,各年龄段,普通人装扮,长发/短发,不同颜色,疼痛,躺下/坐下"
"场景描述": "他带领着军队与丧尸们战斗,一次次逆袭,最终统一了丧尸肆虐的土地",
"场景关键词": "\"末世,丧尸肆虐的土地,战斗,逆袭\"",
"角色": "\"特种兵杨轩\"",
"角色关键词": "\"男性,年轻, 英勇,无畏,勇敢,力量强大,战斗经验丰富\"",
"画面描述词": "He led his army to battle against the ravaging zombies, launching one counterattack after another, until finally unifying the land plagued by the undead. Scene keywords: \"post-apocalyptic, ravaged land, battle, counterattack\" Character: \"Special Forces soldier Yang Xuan\" Character keywords: \"male, young, heroic, fearless, brave, physically powerful, experienced in combat\" He, a young and fearless Special Forces soldier named Yang Xuan, led his army in a series of battles against the ravaging zombies, launching one counterattack after another. With his immense strength and extensive combat experience, he finally unified the land plagued by the undead.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/5.png?v=20240203010742521",
"local_image_path": "assets/outputs/20240203010153059/img/5.png"
},
{
"编号": "6",
"场景描述": "王强组建抗击恶势力的义勇军",
"场景关键词": "古代,村庄内部,白天,室内",
"角色": "王强,义勇军成员",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,决心,坐下/站立"
"场景描述": " 在这个新世界,杨轩成为了王者,摄政了数万女人的心",
"场景关键词": "\"新世界,王者,摄政,数万女人\"",
"角色": "\"杨轩\"",
"角色关键词": "\"性别:男,年龄:成年,肤色:未给出,衣服:特种兵服装,发型:未给出,发色:未给出,脸色:未给出,五官特点:未给出,体态:壮实,情绪:自信,肢体动作:威武\"",
"画面描述词": "In this new world, Yang Xuan has become the king and captured the hearts of tens of thousands of women. Scene keywords: \"new world, king, captured hearts, tens of thousands of women\" Characters in the scene: \"Yang Xuan\" Character keywords: \"Gender: male, Age: adult, Skin color: not specified, Clothing: special forces uniform, Hairstyle: not specified, Hair color: not specified, Facial expression: not specified, Facial features: not specified, Body posture: muscular, Emotion: confident, Body movements: imposing\" Translation: In this new world, Yang Xuan has become the king and has captivated the hearts of tens of thousands of women.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/6.png?v=20240203010809465",
"local_image_path": "assets/outputs/20240203010153059/img/6.png"
},
{
"编号": "7",
"场景描述": "侠盗团队保护受苦的人",
"场景关键词": "古代,村庄内外,白天/夜晚,室内/室外",
"角色": "王强,侠盗团队成员",
"角色关键词": "男性,中年,黑色侠盗装,短发,黑色/金色,坚定,站立/跑动"
"场景描述": "他英勇无敌的战绩和无私的领导才能令女人们痴迷",
"场景关键词": "\"末世, 丧尸横行, 战斗, 逆袭, 统一土地, 新世界, 繁荣\"",
"角色": "\"杨轩, 幸存者, 军队, 女人, 特种兵, 王\"",
"角色关键词": "\"杨轩-性别:男, 年龄:成年, 衣服:军装, 发型:短发, 情绪:勇猛无畏, 肢体动作:闪电般的行动; 幸存者-性别:男或女, 年龄:各种年龄, 衣服:各种服装, 情绪:被杨轩的勇猛无畏所震撼, 肢体动作:投靠杨轩; 军队-性别:男或女, 年龄:各种年龄, 衣服:军装, 情绪:与丧尸战斗, 肢体动作:战斗动作; 女人-性别:女, 年龄:各种年龄, 衣服:各种服装, 情绪:痴迷于杨轩的英勇无畏和无私的领导才能, 肢体动作:被吸引并陶醉于他的怀抱中; 特种兵-性别:男, 年龄:成年, 衣服:特种兵装备, 发型:短发, 情绪:英勇无畏, 肢体动作:血雨腥风的出击; 王-性别:男, 年龄:成年, 衣服:王者装束, 情绪:身份和权势, 肢体动作:统一土地并创造新世界\"",
"画面描述词": "The scene is set in a post-apocalyptic world where zombies roam freely. The protagonist, Yang Xuan, is a brave and invincible warrior with selfless leadership abilities. His remarkable achievements in battles have captivated the women around him. Survivors, both men and women, are in awe of Yang Xuan's fearless demeanor and are drawn to join him. The army, consisting of soldiers of all genders and ages, dons military uniforms and engages in combat with the zombies. The women, dressed in various outfits, are infatuated with Yang Xuan's courageous and selfless leadership qualities. They are enchanted and captivated, willingly surrendering themselves to him. Special forces soldiers, with short hair and equipped in elite gear, show their bravery and fearlessness as they go on daring missions. Lastly, there is a king who possesses power and authority. He unifies the land and creates a new world.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/7.png?v=20240203010934647",
"local_image_path": "assets/outputs/20240203010153059/img/7.png"
},
{
"编号": "8",
"场景描述": "王强与侠盗团队合作",
"场景关键词": "古代,村庄内外,白天/夜晚,室内/室外",
"角色": "王强,侠盗团队成员,村民",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,决心,站立/坐下,侠盗装扮 - 男性,中年,黑色侠盗装,短发,黑色/金色,坚定,站立/跑动 - 男性,女性,各年龄段,普通人装扮,长发/短发,不同颜色,平静,站立/坐下"
"场景描述": "杨轩学会了爱护她们,温情细腻地照顾着每一个人",
"场景关键词": "\"末世, 无敌之城, 新世界, 和平与繁荣\"",
"角色": "\"杨轩, 女人们\"",
"角色关键词": "\"杨轩-特种兵, 英勇无畏, 勇猛无畏, 深爱一个人;女人们-数万女人, 幸存者, 被吸引, 陶醉, 深爱杨轩\"",
"画面描述词": "The scene description is: Yang Xuan learns to care for them and tenderly looks after each person. The keywords for the scene are: \"apocalyptic, invincible city, new world, peace and prosperity\" The characters in the scene are: \"Yang Xuan, the women\" The keywords for the characters are: \"Yang Xuan - special forces soldier, brave and fearless, fearlessly courageous, deeply in love with someone; the women - tens of thousands of women, survivors, attracted, intoxicated, deeply in love with Yang Xuan\" Translation: Yang Xuan has learned to care for them and tenderly looks after each person in a scene set in an apocalyptic, invincible city in a new world of peace and prosperity. Yang Xuan, a special forces soldier, is brave and fearless. He fearlessly courageously protects and cares for everyone around him. Among them, there are tens of thousands of women who have survived the apocalypse. They are attracted to Yang Xuan and become deeply enamored with him. Their love for him is intense and profound.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/8.png?v=20240203010853942",
"local_image_path": "assets/outputs/20240203010153059/img/8.png"
},
{
"编号": "9",
"场景描述": "战斗驱逐恶势力",
"场景关键词": "古代,村庄内外,白天/夜晚,室内/室外",
"角色": "王强,义勇军成员,侠盗团队成员,村民",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,威武,站立/跑动 - 男性,中年,黑色侠盗装,短发,黑色/金色,坚定,站立/跑动 - 男性,女性,各年龄段,普通人装扮,长发/短发,不同颜色,平静,站立/坐下"
"场景描述": "他们被他的坚毅与温柔深深吸引,陶醉在他的怀抱中",
"场景关键词": "\"温馨,亲密\"",
"角色": "\"杨轩,女孩\"",
"角色关键词": "\"男,30岁,无,军装,短发,黑色,红润,阳光帅气,温柔,拥抱\"",
"画面描述词": "They were deeply attracted by his firmness and tenderness, and they were immersed in his embrace.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/9.png?v=20240203010800494",
"local_image_path": "assets/outputs/20240203010153059/img/9.png"
},
{
"编号": "10",
"场景描述": "恢复村庄和平",
"场景关键词": "古代,村庄内外,白天/夜晚,室内/室外",
"角色": "王强,农民,侠盗团队成员",
"角色关键词": "男性,中年,普通人装扮,短发,黑色,喜悦,站立/坐下 - 男性,年轻,农民装扮,短发,黑色,平静,站立/坐下 - 男性,中年,黑色侠盗装,短发,黑色/金色,坚定,站立/跑动"
}
],
// ai_draw_json: <Wm.AiDrawItem[]>[],
ai_draw_json: [
"场景描述": " 然而,杨轩却不为无尽的女人所动,因为他深爱着一个人——那是他在丧尸横行时遇见的纯真灵魂",
"场景关键词": "\"丧尸横行末世, 纯真灵魂\"",
"角色": "\"杨轩\"",
"角色关键词": "\"性别: 男, 年龄: 不详, 肤色: 不详, 衣服: 特种兵军装, 发型: 不详, 发色: 不详, 脸色: 不详, 五官特点: 不详, 体态: 不详, 情绪: 深爱, 肢体动作: 不详\"",
"画面描述词": "However, Yang Xuan was not moved by the countless women around him as he deeply loved someone - a pure soul he had encountered in the midst of a zombie apocalypse. Scene keywords: \"zombie apocalypse, pure soul\" Character: Yang Xuan Character keywords: \"Gender: Male, Age: Unknown, Skin color: Unknown, Clothing: Special Forces military uniform, Hairstyle: Unknown, Hair color: Unknown, Facial expression: Unknown, Facial features: Unknown, Body posture: Unknown, Emotion: Deep love, Body movements: Unknown\"",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/10.png?v=20240203010827435",
"local_image_path": "assets/outputs/20240203010153059/img/10.png"
},
{
"编号": "1",
"场景描述": "曾经的医生王强穿越回了古代,发现这个时代正值战乱时期。他觉得自己是时候行侠仗义,保护那些无辜受苦的人们了",
"画面描述词":
"Wang Qiang found himself standing in an unfamiliar room. The dimly lit interior had an ancient feel to it, with wooden beams and ornate decorations adorning the room. Wang Qiang, a middle-aged man dressed in ordinary clothes, was startled by his sudden transportation through time and space. Although a bit confused, he remained calm and composed. Standing in the room, he observed his surroundings, trying to figure out which era he had arrived in.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/1.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/1.png",
"编号": "11",
"场景描述": "她是唯一敢与他争论,却又唯一能让他动心的存在",
"场景关键词": "\"争论,动心\"",
"角色": "\"特种兵,女孩\"",
"角色关键词": "\"特种兵:性别男,年龄成年,肤色不详,衣服军装,发型不详,发色不详,脸色不详,五官特点坚毅,体态健壮,情绪坚定,肢体动作激烈; 女孩:性别女,年龄不详,肤色不详,衣服不详,发型不详,发色不详,脸色纯真,五官特点不详,体态不详,情绪坚定,肢体动作激烈\"",
"画面描述词": "Scene Description: She is the only one who dares to argue with him, but also the only one who can touch his heart. Keywords in the scene: \"argue, touch the heart\" Characters in the scene: \"Special Forces soldier, girl\" Keywords for the characters: Special Forces soldier: gender: male, age: adult, skin color: unknown, clothes: military uniform, hairstyle: unknown, hair color: unknown, facial expression: unknown, facial features: resolute, body: strong and fit, emotional state: determined, physical actions: intense Girl: gender: female, age: unknown, skin color: unknown, clothes: unknown, hairstyle: unknown, hair color: unknown, facial expression: innocent, facial features: unknown, body: unknown, emotional state: determined, physical actions: intense Translation: She is the only one willing to argue with him, yet also the only one who can touch his heart. The scene involves a Special Forces soldier and a girl.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/11.png?v=20240203010912127",
"local_image_path": "assets/outputs/20240203010153059/img/11.png"
},
{
"编号": "2",
"场景描述": "王强在一个村庄里遇到了一个年轻的农民,叫李明。李明父母在战乱中被杀,他成了孤儿,并且被恶势力欺压",
"画面描述词":
"Scene: War-torn VillageCharacters:Wang Qiang - Male, Middle-aged, Commoner attire, Short hair, Black, Calm, StandingLi Ming - Male, Young, Peasant attire, Short hair, Black, Sad, KneelingWang Qiang stands in the ruins of the war-torn village, observing the destruction surrounding him. The once peaceful village now lies in ruins, with burnt houses and debris scattered everywhere. It is daytime, and the sun casts a gloomy light on the desolate scene.Nearby, Li Ming is seen kneeling on the ground, his head bowed in sorrow. His worn-out farmer's clothes reflect the hardships he has endured. His face, covered in dirt and tears, reveals the deep sadness in his heart. His farm tools lie abandoned next to him, useless in the chaos of war.Wang Qiang remains calm, his eyes filled with determination as he surveys the devastation. Despite the turmoil and despair, he stands tall, his resilience evident. As a middle-aged man, he carries the weight of the village's hopes and dreams on his shoulders, fighting bravely to protect what is left.Meanwhile, Li Ming's youthful innocence and optimism have been shattered by the brutality of war. Kneeling on the ground, he clings onto the fading memories of the peaceful past. The loss and grief he feels are evident in his posture, his trembling hands clasped in prayer, as he seeks solace in a higher power.In this war-torn village, Wang Qiang and Li Ming represent the contrast between the resilience of experience and the vulnerability of youth. They stand as symbols of the collective struggle and resilience of the villagers, amidst the chaos and destruction brought upon by the ancient era of war.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/2.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/2.png",
"编号": "12",
"场景描述": " 杨轩的故事成为了末世传说,他的王朝将永远被世人传颂",
"场景关键词": "\"末世,王朝,传颂\"",
"角色": "\"杨轩,世人\"",
"角色关键词": "\"杨轩:特种兵,勇猛无畏,英勇无敌,温柔的领导,深爱的人,新世界的王; 世人:永远传颂\"",
"画面描述词": "Yang Xuan's story has become a legend of the apocalypse, and his dynasty will be forever celebrated by the world. Keywords of the scene: \"apocalypse, dynasty, celebrated\" Characters in the scene: \"Yang Xuan, people\" Keywords of the characters: \"Yang Xuan: special forces, fearless, invincible, gentle leader, beloved person, king of the new world; People: forever celebrated\" Translation: The story of Yang Xuan has become a legendary tale of the apocalypse, and his dynasty will forever be celebrated by the world. Scene keywords: \"apocalypse, dynasty, celebrated\" Characters in the scene: \"Yang Xuan, people\" Character keywords: \"Yang Xuan: special forces, fearless, invincible, gentle leader, beloved person, king of the new world; People: forever celebrated\"",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/12.png?v=20240203010840686",
"local_image_path": "assets/outputs/20240203010153059/img/12.png"
},
{
"编号": "3",
"场景描述": "王强决定帮助李明。他教授李明一些基本的医术",
"画面描述词":
"Professor Wang Qiang is teaching Doctor Li Ming traditional medical skills. They are in a village, inside a room, during the daytime. Wang Qiang, a middle-aged man with short black hair, wearing ordinary clothes, exudes confidence as he sits down. Li Ming, a young man in farmer's attire, with short black hair, sits down attentively, fully focused on the professor's teachings.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/3.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/3.png",
},
{
"编号": "4",
"场景描述": "并且帮助他恢复村庄的秩序",
"画面描述词":
"Scene: Restoring Order in the VillageCharacters:- Wang Qiang: Male, middle-aged, dressed as an ordinary person, short black hair, confident, standing.- Li Ming: Male, young, dressed as a farmer, short black hair, focused, standing.- Villagers: Male and female, of various ages, dressed as ordinary people, with either long or short hair, different colors, calm, standing or sitting.Translation:Scene description: In ancient times, outside the village during the day, in an outdoor setting.Wang Qiang and Li Ming, both dressed in their ordinary attires, are standing together outside the village. They observe the chaotic situation with determination and a sense of duty, ready to restore order.The villagers, comprising men and women of different ages, are also present. They are calmly standing or sitting, waiting for Wang Qiang and Li Ming to take charge and bring harmony back to their village.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/4.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/4.png",
},
{
"编号": "5",
"场景描述": "为了支援农民,王强到处奔走,为那些受伤的人们进行治疗。他在古代用现代医学知识,快速治愈了一些以前无法治愈的疾病",
"画面描述词":
"Translation:Scene: Wang Qiang treating the injured personPeriod: Ancient timesLocation: Inside a villageTime of day: DaytimeSetting: IndoorsCharacters:1. Wang Qiang - Male, middle-aged, dressed in ordinary attire, short hair, black hair color, professional, seated.2. Injured person - Male/female, various age groups, dressed in ordinary attire, long hair/short hair, different colors, in pain, lying down/sitting.Please note that the Chinese names respectively, and the character descriptions have been directly translated into English.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/5.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/5.png",
},
{
"编号": "6",
"场景描述": "他趁机收集了一群志同道合的人,组建了一个抗击恶势力的义勇军",
"画面描述词":
"Wang Qiang, a middle-aged man with short black hair, dressed as an ordinary person, is sitting in a room inside a village in ancient times. He is filled with determination and is busy assembling a group of volunteers to fight against the evil forces.Wang Qiang: (sitting down, speaking with conviction) Brothers, our village is under attack from these evil forces. We cannot sit back and watch them terrorize our people any longer. It's time to take action and form a militia to protect our loved ones!义勇军成员 (义勇军成员 may refer to members of the militia or volunteers):(nodding in agreement, standing up) You're right, Wang Qiang. We must stand up for justice and defend our village. Count me in!Wang Qiang: (smiling confidently) I knew I could count on you all. Together, we will train and prepare ourselves to face these enemies head-on. Let's gather every able-bodied man in the village and discuss our strategy. We cannot afford to let fear paralyze us.义勇军成员: (determinedly) We will fight with all our might, Wang Qiang. No matter the odds, we will not back down. Our village deserves peace and safety.Wang Qiang: (standing up, clenching his fist) That's the spirit! We will show these evil forces what we're made of. Let's reclaim our village and restore justice to these lands!The group of volunteers joins Wang Qiang in his fight against the evil forces, uniting with a shared resolve and determination to protect their village. The stage is set for their heroic adventure.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/6.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/6.png",
},
{
"编号": "7",
"场景描述": "由于他的医术悉心教导,王强手下的队伍战斗力大增,并且开始挑战恶势力的统治",
"画面描述词":
"In ancient times, in a village day or night, both indoors and outdoors, there is a man named Wang Qiang, who is in his middle age and always wears a black thieves' outfit. He has short hair, and his eyes are firm, shining either black or golden. Wang Qiang is a member of a band of thieves who are known for their noble cause. This group of skilled individuals protects the suffering people by using their discreet talents and abilities. Whether standing or running, they are dedicated to their mission.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/7.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/7.png",
},
{
"编号": "8",
"场景描述": "在战斗中,王强发现一支正义的侠盗团队正在保护受苦的人们。他决定与他们合作,将农民们和侠盗团队联合起来,共同对抗恶势力",
"画面描述词":
"Wang Qiang collaborated with the gang of thieves in an ancient village. The scene was set both inside and outside the village during the day and night.Inside the village, Wang Qiang, a determined man in his middle age, dressed in ordinary clothes with short black hair, stood with the members of the gang, who were dressed in black thief outfits. The gang members also had short black or golden hair and stood with a resolute expression. They discussed their plan while sitting.Outside the village, during the day, Wang Qiang stood with confidence alongside the gang members in their thief outfits. They were all middle-aged men with short black hair, dressed in black thief outfits. They discussed how to execute their plan and were ready to carry it out.At night, inside a house in the village, Wang Qiang and the gang members sat together with a serene expression. They disguised themselves as ordinary villagers, with both men and women of various ages, dressed casually, with either long or short hair in different colors. They calmly discussed their next move.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/8.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/8.png",
},
{
"编号": "9",
"场景描述": "最终,王强和他的队伍,还有侠盗团队成功地将恶势力赶出了村庄,恢复了和平",
"画面描述词":
"Scene: Battle to Expel Evil ForcesThe scene is set in an ancient village, both inside and outside. It can take place during the day or night, and can occur indoors or outdoors.Characters:1. Wang Qiang: a middle-aged man dressed in ordinary clothing. He has short black hair, a strong and imposing presence. He can be either standing or running.2. Members of the Volunteer Army: middle-aged men dressed in black thief outfits. They have short black or golden hair and a determined look on their faces. They can be either standing or running.3. Villagers: both males and females of various age groups dressed as ordinary people. They have different hair colors (long or short) and exhibit a calm demeanor. They can be either standing or sitting.Translation:Scene: The Battle to Expel Evil ForcesInside an ancient village, the brave Wang Qiang leads a team of members from the Volunteer Army. With their black thief outfits and determined expressions, they stand ready to confront the impending danger. Wang Qiang, a middle-aged man with short black hair, exudes strength and commands his fellow soldiers.As the battle takes place, the sun shines down on the village, illuminating their valiant efforts. Wang Qiang and his team swiftly maneuver through the village streets, their footsteps echoing as they run to defend their home.Amidst the chaos, the villagers watch with calm composure. Men, women, and children of all ages, dressed in ordinary clothing, stand united in support. Some sit indoors, seeking refuge from the turmoil, while others stand outside their homes, observing the fight unfold.Although outnumbered, Wang Qiang and his team fight valiantly, dispatching the evil forces with unwavering resolve. With every swing of their swords and the clash of weapons, they protect their beloved village from harm.As night falls, the battle continues under the pale moonlight. Wang Qiang's leadership inspires his team to keep fighting, as they refuse to let darkness cloud their determination. They stand tall, their silhouettes blending with the night, a symbol of unity and bravery.Throughout the epic clash, the villagers offer their silent prayers, hoping for the safety and triumph of their defenders. They hold onto the belief that their collective strength will overcome the evil forces threatening their ancient village.In this battle to expel the evil forces, Wang Qiang and his team, along with the unwavering support of the villagers, stand as beacons of hope, determined to restore peace and reclaim their homeland.",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/9.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/9.png",
},
{
"编号": "10",
"场景描述": "他们在古代留下了无穷的传奇,为人们带来了新的希望和幸福。医生王强也与李明成了好朋友,他们一起守护着村庄的和平与安宁",
"画面描述词":
"Scene: Restoring Peace to the VillageSetting: A village in ancient times, both inside and outside the village.Characters:1. Wang Qiang - Male, middle-aged, dressed as an ordinary person, short hair, black, joyful, standing/sitting.2. Farmer - Male, young, dressed as a farmer, short hair, black, calm, standing/sitting.3. Member of the Thief Team - Male, middle-aged, dressed in black thief attire, short hair, black/gold, determined, standing/running.(Scene begins with the village in chaos. Buildings are burning, villagers are running around in panic.)Wang Qiang: (standing outside a burning house, looking distressed)Oh no, our peaceful village is under attack! We need to do something!(Farmer approaches Wang Qiang, standing beside him)Farmer: (calmly)Wang Qiang, we can't let them destroy our village. We must gather the villagers and defend ourselves.(Wang Qiang and the Farmer start rallying the villagers and organizing them into groups to fight back.)(Scene transitions to a nighttime scene. The village is now fortified, with the villagers and the Thief Team members working together.)Wang Qiang: (standing in front of the villagers, addressing them)We must stay strong and united! Together, we can restore peace to our village!(Member of the Thief Team approaches Wang Qiang, standing beside him)Thief Team Member: (determined)Wang Qiang, we are here to assist you in driving out the invaders. Our skills can be put to good use.(Wang Qiang and the Thief Team Member exchange a nod, signaling their agreement.)(Scene transitions to inside a house, where Wang Qiang and the Farmer are taking a break.)Wang Qiang: (sitting down, catching his breath)I'm grateful for your help, my friend. Together, we can rebuild our village and make it prosperous once again.Farmer: (sitting beside Wang Qiang)Indeed, Wang Qiang. Our unity will not only restore peace but also strengthen our bonds as a community.(Scene ends with Wang Qiang and the Farmer leaving the house, ready to continue their mission of restoring peace to the village, with the Thief Team members by their side.)",
"本镜配图":
"http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/img/10.png",
"task_id": "20240131095112500",
"local_image_path": "assets/outputs/20240131095112500/img/10.png",
}
"编号": "13",
"场景描述": "他用自己的力量创造了新的世界,不再有恐惧和黑暗,取而代之的是和平与繁荣",
"场景关键词": "\"新的世界,恐惧,黑暗,和平,繁荣\"",
"角色": "\"杨轩,幸存者,丧尸,女人,纯真灵魂,世人\"",
"角色关键词": "\"杨轩(性别:男, 年龄:成年, 肤色:未指定, 衣服:特种兵制服, 发型:未指定, 发色:未指定, 脸色:未指定, 五官特点:勇猛无畏, 体态:强壮, 情绪:爱与责任, 肢体动作:战斗), 幸存者(性别:未指定, 年龄:各种年龄段, 肤色:未指定, 衣服:幸存者服装, 发型:未指定, 发色:未指定, 脸色:未指定, 五官特点:深受震撼, 体态:各种, 情绪:希望,投靠于杨轩, 肢体动作:未指定), 丧尸(性别:未指定, 年龄:未指定, 肤色:未指定, 衣服:流浪破损, 发型:未指定, 发色:未指定, 脸色:未指定, 五官特点:巡游, 体态:笨拙, 情绪:进攻, 肢体动作:攻击), 女人(性别:女, 年龄:各种年龄段, 肤色:未指定, 衣服:各种, 发型:未指定, 发色:未指定, 脸色:未指定, 五官特点:被杨轩吸引, 体态:各种, 情绪:痴迷,陶醉, 肢体动作:温柔), 纯真灵魂(性别:女, 年龄:年轻, 肤色:未指定, 衣服:普通, 发型:未指定, 发色:未指定, 脸色:未指定, 五官特点:纯真, 体态:未指定, 情绪:吸引杨轩, 肢体动作:争论), 世人(性别:未指定, 年龄:不确定, 肤色:未指定, 衣服:未指定, 发型:未指定, 发色:未指定, 脸色:未指定, 五官特点:赞美, 体态:未指定, 情绪:传颂, 肢体动作:未指定)\"",
"画面描述词": "He created a new world with his own power, where there is no longer fear and darkness, but instead peace and prosperity. The characters in this scene are: - Yang Xuan (Gender: male, Age: adult, Skin color: unspecified, Clothing: special forces uniform, Hairstyle: unspecified, Hair color: unspecified, Facial expression: unspecified, Physical features: fearless and brave, Body posture: strong, Emotion: love and responsibility, Body action: fighting) - Survivors (Gender: unspecified, Age: various age groups, Skin color: unspecified, Clothing: survivor clothing, Hairstyle: unspecified, Hair color: unspecified, Facial expression: unspecified, Physical features: deeply shocked, Body posture: various, Emotion: hope, seeking shelter with Yang Xuan, Body action: unspecified) - Zombies (Gender: unspecified, Age: unspecified, Skin color: unspecified, Clothing: ragged and torn, Hairstyle: unspecified, Hair color: unspecified, Facial expression: unspecified, Physical features: wandering, Body posture: clumsy, Emotion: attacking, Body action: attacking) - Woman (Gender: female, Age: various age groups, Skin color: unspecified, Clothing: various, Hairstyle: unspecified, Hair color: unspecified, Facial expression: unspecified, Physical features: attracted to Yang Xuan, Body posture: various, Emotion: infatuation, Body action: gentle) - Pure Soul (Gender: female, Age: young, Skin color: unspecified, Clothing: ordinary, Hairstyle: unspecified, Hair color: unspecified, Facial expression: unspecified, Physical features: innocent, Body posture: unspecified, Emotion: attracted to Yang Xuan, Body action: arguing) - The People (Gender: unspecified, Age: uncertain, Skin color: unspecified, Clothing: unspecified, Hairstyle: unspecified, Hair color: unspecified, Facial expression: unspecified, Physical features: praising, Body posture: unspecified, Emotion: spreading, Body action: unspecified)",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/13.png?v=20240203010944347",
"local_image_path": "assets/outputs/20240203010153059/img/13.png"
},
{
"编号": "14",
"场景描述": " 这是一个故事,关于一个特种兵,杀戮如潮,却为了寻找爱情而战斗",
"场景关键词": "\"末世,丧尸横行,摇摇欲坠的王城,新世界,和平与繁荣\"",
"角色": "\"特种兵杨轩,其他幸存者,数万女人,纯真灵魂,世人\"",
"角色关键词": "\"男性,年轻,无肤色要求,军装,短发,黑色,坚毅,温柔,感动,吸引,怀抱,传颂\"",
"画面描述词": "This is a story about a special soldier, who is ruthless in killing but fights for love. The scene is set in a collapsing royal city during the apocalypse, where zombies roam free. In this new world, the ultimate goal is to restore peace and prosperity. The main character is Yang Xuan, a special soldier, accompanied by other survivors. There are also tens of thousands of women, with pure souls. The story explores how Yang Xuan, a young man with no specific racial requirements, dressed in military uniform with short black hair, exhibits both determination and tenderness. His actions and character deeply move and attract others, resulting in him being celebrated by the world.",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/14.png?v=20240203010902914",
"local_image_path": "assets/outputs/20240203010153059/img/14.png"
},
{
"编号": "15",
"场景描述": "他成为了新世界的王,但他最终明白,真正让他心驰神往的不是权势与财富,而是那个平凡而温暖的女孩",
"场景关键词": "\"新世界,王,权势,财富,平凡,温暖,女孩\"",
"角色": "\"杨轩\"",
"角色关键词": "\"性别:男,年龄:成年,肤色:不确定,衣服:军装,发型:不确定,发色:不确定,脸色:不确定,五官特点:不确定,体态:坚毅,情绪:明悟,肢体动作:无\"",
"画面描述词": "He became the king of a new world, but in the end, he realized that what truly captivated his heart was not power and wealth, but that ordinary and warm-hearted girl. Scene keywords: \"new world, king, power, wealth, ordinary, warm-hearted, girl\" Character: \"Yang Xuan\" Character keywords: \"Gender: male, Age: adult, Skin color: uncertain, Clothing: military uniform, Hairstyle: uncertain, Hair color: uncertain, Facial expression: uncertain, Facial features: uncertain, Body posture: resolute, Emotion: enlightenment, Body movements: none\" Translation: He ascended to become the king of a new world, but eventually he understood that what truly fascinated him was not authority and riches, but that ordinary and heartwarming girl. Scene keywords: \"new world, king, authority, riches, ordinary, heartwarming, girl\" Character: \"Yang Xuan\" Character keywords: \"Gender: male, Age: adult, Skin color: uncertain, Clothing: military uniform, Hairstyle: uncertain, Hair color: uncertain, Facial expression: uncertain, Facial features: uncertain, Body posture: resolute, Emotion: enlightenment, Body movements: none\"",
"本镜配图": "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/img/15.png?v=20240203010921369",
"local_image_path": "assets/outputs/20240203010153059/img/15.png"
}
],
final_video: "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240131095112500/final_video.mp4",
final_video: "http://wm_tools_backend.frp.wmdigit.com:8888/assets/outputs/20240203010153059/final_video.mp4",
});
const task_id = ref("20240203010153059")
const sd_prompt_prefix = `best quality,masterpiece,realistic,HDR,UHD,8K,best quality,highres,absurdres,realistic,masterpiece,
Highly detailed,extreme detail description,Professional,cinematic_lighting,ultra-fine painting,full body,
Vivid Colors,physically-based rendering,cinematic,`;
......@@ -234,15 +208,31 @@ disconnected limbs,malformed hands,out of focus,long neck,long body,gape,`;
onMounted(() => { });
const onSubmitGpt = () => {
task_id.value = utils.genDateTimeStr();
console.log(task_id.value)
text2videoService
.submitGpt(form.chatgpt_prompt)
.then((result: string) => {
// console.log(result);
form.chatgpt_answer = result;
// 按标点拆分分镜数量
// 按标点拆分成分镜
const sentences = utils.splitText(form.chatgpt_answer);
console.log(sentences.length)
// form.adapt_restrict = `将上述文案改编为${sentences.length}个短视频分镜,给出每个分镜的场景描述、场景关键词(年代,空间,时间段,地理环境,天气,物品,人物,镜头角度)、角色、角色关键词(性别,年龄,肤色,衣服,发型,发色,脸色,五官特点,体态,情绪,肢体动作)。以如下json字符串的格式返回:{"分镜":[{"编号":"","场景描述":"","场景关键词":"","角色":"","角色关键词":""},...]}`;
// 分镜
form.adapt_result_json = []
for (let i = 0; i < sentences.length; i++) {
form.adapt_result_json.push({
"编号": (i + 1).toString(),
"场景描述": sentences[i],
"场景关键词": "",
"角色": "",
"角色关键词": "",
"画面描述词": "",
"本镜配图": "",
"local_image_path": "",
});
}
console.log(form.adapt_result_json)
})
.catch((error: any) => {
// console.error(error);
......@@ -253,98 +243,29 @@ const onSubmitGpt = () => {
});
};
const onAdapt = () => {
if (!form.chatgpt_answer || !form.adapt_restrict) {
const onAdapt = async () => {
if (!form.adapt_result_json || form.adapt_result_json.length == 0) {
ElMessage({
message: "内容不能为空",
message: "分镜不能为空",
type: "error",
});
return;
}
text2videoService
.submitGpt(form.chatgpt_answer + "\n" + form.adapt_restrict)
.then((result: string) => {
console.log(result);
try {
form.adapt_result_json = utils.formatJsonObj(result).分镜;
} catch (error) {
form.adapt_result = result;
is_adapt_result_json.value = 0;
}
})
.catch((error: any) => {
console.error(error);
ElMessage({
message: error,
type: "error",
});
});
};
const onDraw = async () => {
loading.value = true;
const task_id = utils.genDateTimeStr();
form.task_id = task_id;
task_id.value = utils.genDateTimeStr();
console.log(task_id.value)
// 循环处理每个分镜
const taskPromises = form.adapt_result_json.map(async (item) => {
try {
const result = await text2videoService.submitGpt(
// `场景描述为:${item.场景描述}\n场景关键词为:${item.场景关键词}\n场景中的角色有:${item.角色}\n角色关键词为:${item.角色关键词}\n请理解以上内容,并翻译为相应的英文场景,保留人物和场景的特征和描写。以如下格式返回:Scene:... \nCharacters:...\n`
`场景描述为:${item.场景描述}\n场景关键词为:${item.场景关键词}\n场景中的角色有:${item.角色}\n角色关键词为:${item.角色关键词}\n请理解以上内容,并翻译为相应的英文。`
);
// const newResult = result.replaceAll(".", "").replaceAll('"', "");
const newResult = result
try {
const sd_prompt = newResult + "," + sd_prompt_prefix;
const sd_result = await text2videoService.submitSD(
task_id,
item.编号,
sd_prompt,
sd_negative_prompt_prefix
);
return {
编号: item.编号,
场景描述: item.场景描述,
画面描述词: newResult,
本镜配图: sd_result.domain_image_path,
task_id: task_id,
local_image_path: sd_result.local_image_path,
};
} catch (error) {
ElMessage({
message: String(error),
type: "error",
});
return {
编号: item.编号,
场景描述: item.场景描述,
画面描述词: newResult,
本镜配图: "",
task_id: task_id,
local_image_path: "",
};
}
} catch (error) {
// console.error(error);
ElMessage({
message: String(error),
type: "error",
});
return {
编号: item.编号,
场景描述: item.场景描述,
画面描述词: "",
本镜配图: "",
task_id: task_id,
local_image_path: "",
};
}
await onAdaptOne(item);
await onDrawOne(item);
});
// 所有请求都返回后,重新排序
try {
const results = await Promise.all(taskPromises);
form.ai_draw_json = [];
form.ai_draw_json = results.sort((a, b) => parseInt(a.编号) - parseInt(b.编号));
console.log(form.ai_draw_json);
// 等待所有请求都返回
await Promise.all(taskPromises);
ElMessage({
message: String("all over"),
type: "success",
});
} catch (error) {
// 处理错误
ElMessage({
......@@ -357,32 +278,91 @@ const onDraw = async () => {
}
};
const onDrawOne = (idxStr: string) => {
const idx = parseInt(idxStr) - 1;
const task_id = form.ai_draw_json[idx].task_id;
// console.log(task_id)
const newResult = form.ai_draw_json[idx].画面描述词;
const sd_prompt = newResult + "," + sd_prompt_prefix;
text2videoService
.submitSD(task_id, idxStr, sd_prompt, sd_negative_prompt_prefix)
.then((sd_result: any) => {
// console.log(sd_result);
form.ai_draw_json[idx].本镜配图 = "";
form.ai_draw_json[idx].本镜配图 = sd_result.domain_image_path+"?v="+utils.genDateTimeStr();
form.ai_draw_json[idx].local_image_path = "";
form.ai_draw_json[idx].local_image_path = sd_result.local_image_path;
})
.catch((error: any) => {
// console.error(error);
ElMessage({
message: error,
type: "error",
});
const onAdaptOne = async (item: any) => {
if (!item.场景描述) {
ElMessage({
message: "分镜场景描述不能为空",
type: "error",
});
return;
}
// 推理关键词
try {
const adapt_restrict = `请理解这个故事,针对其中的这个场景:“${item.场景描述}”,给出这个场景的:
场景关键词(年代,空间,时间段,地理环境,天气,物品,人物,镜头角度)、
角色、
角色关键词(性别,年龄,肤色,衣服,发型,发色,脸色,五官特点,体态,情绪,肢体动作)。
角色和角色关键词要对应。
以如下json字符串的格式返回:{"场景关键词":"(多个词以逗号分隔)","角色":"(角色以逗号分隔)","角色关键词":"(分别给予对应角色的关键词,多个词以逗号分隔)"}`;
const keywords = await text2videoService.submitGpt(form.chatgpt_answer + "\n" + adapt_restrict);
// console.log(keywords)
const keywords_obj = utils.formatJsonObj(keywords)
// console.log(keywords_obj)
item.场景关键词 = JSON.stringify(keywords_obj.场景关键词);
item.角色 = JSON.stringify(keywords_obj.角色);
item.角色关键词 = JSON.stringify(keywords_obj.角色关键词);
} catch (error) {
ElMessage({
message: String(error),
type: "error",
});
}
};
const onDrawOne = async (item: any) => {
if (!item.编号 || !item.场景描述 || !item.场景关键词 || !item.角色 || !item.角色关键词) {
ElMessage({
message: "分镜参数不能为空",
type: "error",
});
return;
}
// 翻译+画图
if (!task_id.value) {
task_id.value = utils.genDateTimeStr();
console.log(task_id.value)
}
try {
const sd_describe = await text2videoService.submitGpt(
`场景描述为:${item.场景描述}\n场景关键词为:${item.场景关键词}\n场景中的角色有:${item.角色}\n角色关键词为:${item.角色关键词}\n请理解以上内容,并翻译为相应的英文。`
);
item.画面描述词 = sd_describe;
const sd_prompt = item.画面描述词 + "," + sd_prompt_prefix;
const sd_img = await text2videoService.submitSD(task_id.value, item.编号, sd_prompt, sd_negative_prompt_prefix);
item.本镜配图 = sd_img.domain_image_path+"?v="+utils.genDateTimeStr();
item.local_image_path = sd_img.local_image_path;
} catch (error) {
ElMessage({
message: String(error),
type: "error",
});
}
};
const onGenVideo = () => {
const video_param_detail = form.ai_draw_json.map(item => {
if (!form.adapt_result_json || form.adapt_result_json.length == 0 ) {
ElMessage({
message: "必要信息不能为空,请重新执行",
type: "error",
});
return;
}
let is_all_ok = true;
form.adapt_result_json.map(item => {
if (item.编号 == "" || item.场景描述 == "" || item.local_image_path == "") {
ElMessage({
message: `分镜 ${item.编号} 的必要信息为空,请重新执行`,
type: "error",
});
is_all_ok = false;
}
});
if (!is_all_ok) return;
console.log(form.adapt_result_json)
const video_param_detail = form.adapt_result_json.map(item => {
return {
idx: item.编号,
text: item.场景描述,
......@@ -390,7 +370,7 @@ const onGenVideo = () => {
};
});
const video_param = {
task_id: form.task_id,
task_id: task_id.value,
task_info: video_param_detail
}
text2videoService
......@@ -414,29 +394,23 @@ const onGenVideo = () => {
<main class="home-container">
<!-- 标题 -->
<el-divider content-position="left">text2video</el-divider>
<el-form :model="form" label-width="114px">
<!-- 小说到文案 -->
<el-form-item label="小说">
<el-input v-model="form.chatgpt_prompt" :autosize="true" type="textarea" placeholder="输入小说" />
<el-form :model="form" label-width="114px" v-loading="loading">
<!-- Prompt到文案 -->
<el-form-item label="Text">
<el-input v-model="form.chatgpt_prompt" :autosize="true" type="textarea" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmitGpt">提交chatgpt,生成文案</el-button>
<el-button type="primary" @click="onSubmitGpt">提交gpt,生成文案</el-button>
</el-form-item>
<el-form-item label="文案">
<el-input v-model="form.chatgpt_answer" :autosize="true" type="textarea" />
</el-form-item>
<!-- 文案到分镜 -->
<el-form-item label="分镜要求">
<el-input v-model="form.adapt_restrict" :autosize="true" type="textarea" placeholder="" />
</el-form-item>
<!-- 分镜 -->
<el-form-item>
<el-button type="primary" @click="onAdapt">填写或修改分镜要求,提交chatgpt,生成分镜</el-button>
</el-form-item>
<el-form-item label="分镜" v-if="is_adapt_result_json === 0">
<el-input v-model="form.adapt_result" :autosize="true" type="textarea" />
<el-button type="primary" @click="onAdapt">推理关键词,并绘图</el-button>
</el-form-item>
<el-form-item label="分镜" v-if="is_adapt_result_json === 1">
<el-table :data="form.adapt_result_json" border style="width: 100%">
<el-form-item label="分镜">
<el-table :data="form.adapt_result_json" border style="width: 100%; z-index: calc(var(--el-table-index) -1)">
<el-table-column prop="编号" label="编号" width="60" />
<el-table-column prop="场景描述" label="场景描述">
<template v-slot="scope">
......@@ -458,33 +432,24 @@ const onGenVideo = () => {
<el-input v-model="scope.row.角色关键词" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
</el-table>
</el-form-item>
<!-- 画图 -->
<el-form-item>
<el-button type="primary" @click="onDraw">组合SD提示词并绘图</el-button>
</el-form-item>
<el-form-item label="绘图">
<el-table :data="form.ai_draw_json" border style="width: 100%; z-index: calc(var(--el-table-index) -1)"
v-loading="loading">
<el-table-column prop="编号" label="编号" width="60" />
<el-table-column prop="场景描述" label="场景描述" width="200" />
<el-table-column prop="画面描述词" label="画面描述词">
<template v-slot="scope">
<el-input v-model="scope.row.画面描述词" :autosize="true" type="textarea"></el-input>
</template>
</el-table-column>
<el-table-column prop="本镜配图" label="本镜配图" width="300">
<template v-slot="scope">
<div>
<el-image :src="scope.row.本镜配图" :zoom-rate="1.2" :max-scale="1.5" :min-scale="0.5"
:preview-src-list="[scope.row.本镜配图]" fit="cover" :hide-on-click-modal="true" />
:preview-src-list="[scope.row.本镜配图]" fit="cover" :hide-on-click-modal="true"
/>
</div>
</template>
</el-table-column>
<el-table-column width="100" label="操作">
<el-table-column width="120" label="操作" align="center">
<!--
<template v-slot:header>
<el-button type="danger" size="default" @click="">批量绘制所有图片</el-button>
</template>
-->
<template v-slot="scope">
<el-button type="primary" size="small" @click="onDrawOne(scope.row.编号)">重绘本镜</el-button>
<div style="margin: 10px 0"><el-button type="primary" size="default" @click="onAdaptOne(scope.row)">重新推理</el-button></div>
<div style="margin: 10px 0"><el-button type="primary" size="default" @click="onDrawOne(scope.row)">重绘本镜</el-button></div>
</template>
</el-table-column>
</el-table>
......
declare namespace Wm {
interface ScriptsItem {
编号: string
场景描述: string
场景关键词: string
角色: string
角色关键词: string
}
interface AiDrawItem {
编号: string
场景描述: string
画面描述词: string
本镜配图: string
task_id: string
}
interface GenVideo {
task_id: string
task_info: GenVideoItem[]
}
interface GenVideoItem {
idx: string
text: string
img_path: string
}
}
declare namespace Wm {
interface ScriptsItem {
编号: string
场景描述: string
场景关键词: string
角色: string
角色关键词: string
"编号": string,
"场景描述": string,
"场景关键词": string,
"角色": string,
"角色关键词": string,
"画面描述词": string,
"本镜配图": string,
"local_image_path": string,
}
interface AiDrawItem {
编号: string
场景描述: string
画面描述词: string
本镜配图: string
task_id: string
interface GenVideo {
"task_id": string,
"task_info": GenVideoItem[],
}
interface GenVideoItem {
task_id: string
idx: string
text: string
img_path: string
"idx": string,
"text": string,
"img_path": 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