useManyValues.ts 9.82 KB
Newer Older
周成波's avatar
周成波 committed
1 2 3 4 5 6 7 8
import { ref, reactive } from 'vue'
import type { CSSProperties } from 'vue'

interface MyMarkInterface {
  style: CSSProperties
  label: string
}
type MyMarkType = Record<number, MyMarkInterface | string>
周成波's avatar
周成波 committed
9 10 11

export const useManyValues = () => {
  const screen = "竖屏";
周成波's avatar
周成波 committed
12 13
  const horizontal_img_size = {width: "960", height: "540"};
  const vertical_img_size = {width: "540", height: "960"};
周成波's avatar
周成波 committed
14 15
  const if_need_subtitle = "false";

周成波's avatar
周成波 committed
16
  const sd_prompt_prefix = `,best quality,masterpiece,realistic,HDR,UHD,8K,best quality,highres,absurdres,realistic,masterpiece,
周成波's avatar
周成波 committed
17
  Highly detailed,extreme detail description,Professional,cinematic_lighting,ultra-fine painting,full body,Vivid Colors,
周成波's avatar
周成波 committed
18
  physically-based rendering,cinematic,<lora:sdxl_lightning_8step_lora:0.2>`;
周成波's avatar
周成波 committed
19

20
  const sd_negative_prompt_prefix = `multiple breasts, (mutated hands and fingers:1.5), (long body :1.3), 
周成波's avatar
周成波 committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
  (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,`;

周成波's avatar
周成波 committed
53 54 55 56 57 58 59
  const llms = {
    tyqw_online: {'api': 'tyqw', 'name':'线上通义千问'},
    baichuan: {'api': 'langchain', 'name':'本地baichuan2-7b'},
    qwen_local: {'api': 'langchain', 'name':'本地Qwen-7B-Chat'},
    chatgpt: {'api': 'gpt', 'name':'chatgpt'},
  };

周成波's avatar
周成波 committed
60 61
  const horizontal_data = {
    task_id: "20240209114425596",
周成波's avatar
周成波 committed
62
    chatgpt_prompt: `生成一个50字的小故事`,
周成波's avatar
周成波 committed
63 64 65 66
    chatgpt_answer: ``,
    chatgpt_answer_roles: [],
    adapt_result_json: [],
    final_video: ``,
周成波's avatar
周成波 committed
67 68 69
  };

  const vertical_data = {
70
    task_id: "20240220181602687",
周成波's avatar
周成波 committed
71
    chatgpt_prompt: `生成一个50字的科幻小故事,阿凡达系列`,
周成波's avatar
周成波 committed
72
    chatgpt_answer: `在宁静的森林里。一场奇特的食物大战正在上演。一只机灵的小松鼠。眼尖地发现了一块香气扑鼻的奶油蛋糕,正惬意地躺在熊猫阿宝的竹篮里。蛋糕上的水果点缀和醇厚的奶油似乎在向小松鼠招手,它的口水都快流成一条小溪了。`,
周成波's avatar
周成波 committed
73
    chatgpt_answer_roles: [],
周成波's avatar
周成波 committed
74
    adapt_result_json: [],
75
    final_video: ``,
周成波's avatar
周成波 committed
76 77
  };

周成波's avatar
周成波 committed
78
  const en_vertical_data = {
79
    task_id: "20240225222232784",
周成波's avatar
周成波 committed
80
    chatgpt_prompt: `Generate a 50 words science fiction short story, Avatar series`,
81
    chatgpt_answer: `In a futuristic world, humans have developed the ability to upload their consciousness into virtual avatars. These avatars explore distant planets, collecting information for their creators. One day, a group of avatars stumble upon a planet inhabited by sentient beings who are also able to upload their consciousness. A new alliance is formed.`,
82 83 84
    chatgpt_answer_roles: [],
    adapt_result_json: [],
    final_video: ``,
周成波's avatar
周成波 committed
85
  };
周成波's avatar
周成波 committed
86

周成波's avatar
周成波 committed
87 88 89 90 91 92 93 94 95 96 97
  const marks = reactive<MyMarkType>({
    '-100': '-100%',
    '-90': '-90%',
    '-80': '-80%',
    '-70': '-70%',
    '-60': '-60%',
    '-50': '-50%',
    '-40': '-40%',
    '-30': '-30%',
    '-20': '-20%',
    '-10': '-10%',
周成波's avatar
周成波 committed
98 99 100 101 102 103
    0: {
      style: {
        color: '#1989FA',
      },
      label: '标准',
    },
周成波's avatar
周成波 committed
104 105 106 107 108 109 110 111 112 113
    10: '+10%',
    20: '+20%',
    30: '+30%',
    40: '+40%',
    50: '+50%',
    60: '+60%',
    70: '+70%',
    80: '+80%',
    90: '+90%',
    100: '+100%',
114 115 116 117 118 119 120 121 122 123 124 125 126 127
  });

  const bgm_volume_marks = reactive<MyMarkType>({
    0: '-100%',
    0.5: '-50%',
    1.0: {
      style: {
        color: '#1989FA',
      },
      label: '标准音量',
    },
    1.5: '+50%',
    2.0: '+100%',
  });
128

周成波's avatar
周成波 committed
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
  const voices = [
    {
      value: 'zh-CN-liaoning-XiaobeiNeural',
      gender: 'Female',
      label: '女,东北口音',
    },
    {
      value: 'zh-CN-shaanxi-XiaoniNeural',
      gender: 'Female',
      label: '女,陕西口音',
    },
    {
      value: 'zh-CN-XiaoxiaoNeural',
      gender: 'Female',
      label: '女,像个老师',
    },
    {
      value: 'zh-CN-XiaoyiNeural',
      gender: 'Female',
      label: '女,小女孩',
    },
    {
      value: 'zh-CN-YunjianNeural',
      gender: 'Male',
      label: '男,成熟稳重',
    },
    {
      value: 'zh-CN-YunxiaNeural',
      gender: 'Male',
      label: '男,小男孩',
    },
    {
      value: 'zh-CN-YunxiNeural',
      gender: 'Male',
      label: '男,大哥哥',
    },{
      value: 'zh-CN-YunyangNeural',
      gender: 'Male',
      label: '男,像个播音员',
    },{
      value: 'zh-HK-HiuGaaiNeural',
      gender: 'Female',
      label: '女,粤语,中年',
    },{
      value: 'zh-HK-HiuMaanNeural',
      gender: 'Female',
      label: '女,粤语,年轻',
    },{
      value: 'zh-HK-WanLungNeural',
      gender: 'Male',
      label: '男,粤语',
    },{
      value: 'zh-TW-HsiaoChenNeural',
      gender: 'Female',
      label: '女,台湾腔',
    },{
      value: 'zh-TW-HsiaoYuNeural',
      gender: 'Female',
      label: '女,台湾,偏普通话',
    },{
      value: 'zh-TW-YunJheNeural',
      gender: 'Male',
      label: '男,台湾腔',
    },
周成波's avatar
周成波 committed
193
  ];
周成波's avatar
周成波 committed
194

195 196 197 198 199 200
  const voices_en = [
    {
      value: 'en-US-BrianNeural',
      gender: 'Male',
      label: '男,美式磁性',
    },
周成波's avatar
周成波 committed
201
  ];
202

周成波's avatar
周成波 committed
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
  const bgm = [
    {
      value: '',
      label: '无',
    },
    {
      value: '安魂曲',
      label: '安魂曲',
    },
    {
      value: '解忧曲',
      label: '解忧曲',
    },
    {
      value: 'Anacreon',
      label: 'Anacreon',
    },
    {
      value: 'MySunset',
      label: 'MySunset',
    },
    {
      value: 'WindyHill',
      label: 'WindyHill',
    },
228 229 230 231 232 233 234 235
    {
      value: '雨声',
      label: '雨声',
    },
    {
      value: '大自然',
      label: '大自然',
    },
周成波's avatar
周成波 committed
236 237 238 239 240 241 242 243 244 245 246 247
  ];

  const role_attribute_options = [
    {
      value: '人',
      label: '人',
    },
    {
      value: '动物',
      label: '动物',
    },
  ];
248 249 250 251 252 253 254 255 256 257 258 259

  const sd_paras = {
    dreamshaperXL_v21TurboDPMSDE: {
      sampler_index: "DPM++ SDE Karras",
      seed: "-1",
      steps: "6",
      cfg_scale: "2",
    },
    juggernautXL_v9Rdphoto2Lightning: {
      sampler_index: "Euler",
      seed: "-1",
      steps: "8",
周成波's avatar
周成波 committed
260
      cfg_scale: "1.5",
261 262
    },
  };
周成波's avatar
周成波 committed
263
  
周成波's avatar
周成波 committed
264 265
  return {
    screen: screen,
周成波's avatar
周成波 committed
266 267
    horizontal_img_size: horizontal_img_size,
    vertical_img_size: vertical_img_size,
周成波's avatar
周成波 committed
268 269
    sd_prompt_prefix: sd_prompt_prefix,
    sd_negative_prompt_prefix: sd_negative_prompt_prefix,
周成波's avatar
周成波 committed
270
    llms: llms,
周成波's avatar
周成波 committed
271 272 273
    horizontal_data: horizontal_data,
    vertical_data: vertical_data,
    if_need_subtitle: if_need_subtitle,
周成波's avatar
周成波 committed
274
    en_vertical_data: en_vertical_data,
周成波's avatar
周成波 committed
275 276
    marks: marks,
    voices: voices,
277
    voices_en: voices_en,
周成波's avatar
周成波 committed
278
    bgm: bgm,
279
    bgm_volume_marks: bgm_volume_marks,
周成波's avatar
周成波 committed
280
    role_attribute_options: role_attribute_options,
281
    sd_paras: sd_paras,
周成波's avatar
周成波 committed
282 283
  }
}