Fit veo (#267)
This commit is contained in:
1 parent
8b9f3530c2
commit
bafb2cf8d2
42 files changed
+1075
-618
No files matched your search
@@ -3,6 +3,8 @@
|
||||
<div class="flex-1 overflow-y-auto p-[15px]">
|
||||
<video-from-input v-show="config?.action === 'get1080p'" class="mb-4" />
|
||||
<action-selector class="mb-4" />
|
||||
<translation-selector v-show="config?.action !== 'get1080p'" class="mb-4" />
|
||||
<aspect-ratio-selector v-show="config?.action === 'image2video'" class="mb-4" />
|
||||
<prompt-input v-show="config?.action !== 'get1080p'" class="mb-4" />
|
||||
<model-selector v-show="config?.action !== 'get1080p'" class="mb-4" />
|
||||
<start-end-image v-show="config?.action === 'image2video'" class="mb-2" />
|
||||
@@ -23,6 +25,8 @@ import { ElButton } from 'element-plus';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import ModelSelector from './config/ModelSelector.vue';
|
||||
import ActionSelector from './config/ActionSelector.vue';
|
||||
import TranslationSelector from './config/TranslationSelector.vue';
|
||||
import AspectRatioSelector from './config/AspectRatioSelector.vue';
|
||||
import VideoFromInput from './config/VideoFromInput.vue';
|
||||
import StartEndImage from './config/StartEndImage.vue';
|
||||
import Consumption from '../common/Consumption.vue';
|
||||
@@ -39,7 +43,9 @@ export default defineComponent({
|
||||
ModelSelector,
|
||||
StartEndImage,
|
||||
ActionSelector,
|
||||
VideoFromInput
|
||||
VideoFromInput,
|
||||
TranslationSelector,
|
||||
AspectRatioSelector
|
||||
},
|
||||
emits: ['generate'],
|
||||
computed: {
|
||||
|
||||
@@ -15,7 +15,7 @@ import { ElSelect, ElOption } from 'element-plus';
|
||||
import { VEO_DEFAULT_ACTION } from '@/constants';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ModelSelector',
|
||||
name: 'ActionSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<div>
|
||||
<span class="text-sm font-bold mb-2 block">{{ $t('veo.name.ratio') }}</span>
|
||||
<div class="items">
|
||||
<div
|
||||
v-for="(option, optionKey) in options"
|
||||
:key="optionKey"
|
||||
:class="{ active: active === optionKey, item: true }"
|
||||
@click="value = option.value"
|
||||
>
|
||||
<div class="preview" :class="option.label">
|
||||
<div class="rect" :style="{ width: option.width + 'px', height: option.height + 'px' }"></div>
|
||||
</div>
|
||||
<p class="name">
|
||||
{{ option.label }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { VEO_DEFAULT_ASPECT_RATIO } from '@/constants';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'AspectRatioSelector',
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: '1:1',
|
||||
label: '1:1',
|
||||
width: 20,
|
||||
height: 20
|
||||
},
|
||||
{
|
||||
value: '4:3',
|
||||
label: '4:3',
|
||||
width: 20,
|
||||
height: 15
|
||||
},
|
||||
{
|
||||
value: '3:4',
|
||||
label: '3:4',
|
||||
width: 15,
|
||||
height: 20
|
||||
},
|
||||
{
|
||||
value: '16:9',
|
||||
label: '16:9',
|
||||
width: 25,
|
||||
height: 13
|
||||
},
|
||||
{
|
||||
value: '9:16',
|
||||
label: '9:16',
|
||||
width: 13,
|
||||
height: 25
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
active() {
|
||||
return this.options.findIndex((option) => option.value === this.value) || 0;
|
||||
},
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.veo?.config?.aspect_ratio;
|
||||
},
|
||||
set(val: string) {
|
||||
console.debug('set aspect_ratio', val);
|
||||
this.$store.commit('veo/setConfig', {
|
||||
...this.$store.state?.veo?.config,
|
||||
aspect_ratio: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = VEO_DEFAULT_ASPECT_RATIO;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.items {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.item {
|
||||
width: 48px;
|
||||
height: 65px;
|
||||
border: 1px solid var(--el-border-color);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
border-radius: var(--el-border-radius-base);
|
||||
|
||||
.preview {
|
||||
margin-top: 5px;
|
||||
margin-bottom: 3px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.rect {
|
||||
border: 1px solid var(--el-border-color);
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: var(--el-text-color-primary);
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: var(--el-color-primary);
|
||||
.rect {
|
||||
border-color: var(--el-color-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div class="relative">
|
||||
<div class="flex justify-between">
|
||||
<div class="flex justify-start items-center">
|
||||
<span class="text-sm font-bold">{{ $t('veo.name.translation') }}</span>
|
||||
<info-icon :content="$t('veo.description.translation')" />
|
||||
</div>
|
||||
<div class="flex justify-end items-center">
|
||||
<el-switch v-model="value" class="value" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSwitch } from 'element-plus';
|
||||
import { VEO_DEFAULT_TRANSLATION } from '@/constants';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'TranslationSelector',
|
||||
components: {
|
||||
ElSwitch,
|
||||
InfoIcon
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.veo?.config?.translation;
|
||||
},
|
||||
set(val: boolean) {
|
||||
console.debug('set translation', val);
|
||||
this.$store.commit('veo/setConfig', {
|
||||
...this.$store.state.veo?.config,
|
||||
translation: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.value === undefined) {
|
||||
this.value = VEO_DEFAULT_TRANSLATION;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Reference in new issue
Block a user