Improve midjourney experience (#45)
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"type": "patch",
|
||||
"comment": "improve mj experience",
|
||||
"packageName": "@zhishuyun/hub",
|
||||
"email": "cqc@germey.cn",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="mb-4">
|
||||
<h2 class="title">{{ $t('midjourney.field.finalPrompt') }}</h2>
|
||||
<el-alert :title="modelValue" :closable="false" />
|
||||
<el-alert :title="modelValue" :closable="false" class="pt-3" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -27,7 +27,7 @@ export default defineComponent({
|
||||
<style lang="scss" scoped>
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin-bottom: 10px;
|
||||
width: 30%;
|
||||
}
|
||||
.prompt {
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<template>
|
||||
<div class="panel">
|
||||
<model-selector v-model="preset.model" class="mb-4" />
|
||||
<ratio-selector v-model="preset.ratio" class="mb-4" />
|
||||
<quality-selector v-model="preset.quality" class="mb-4" />
|
||||
<version-selector v-model="preset.version" class="mb-4" />
|
||||
<translation-selector v-model="preset.translation" class="mb-4" />
|
||||
<advanced-selector v-model="preset.advanced" class="mb-4" />
|
||||
<stylize-selector v-if="preset.advanced" v-model="preset.stylize" class="mb-4" />
|
||||
<weird-selector v-if="preset.advanced" v-model="preset.wired" class="mb-4" />
|
||||
<chaos-selector v-if="preset.advanced" v-model="preset.chaos" class="mb-4" />
|
||||
<image-weight-selector v-if="preset.advanced" v-model="preset.iw" class="mb-4" />
|
||||
<niji-selector v-if="false" v-model="preset.niji" class="mb-4" />
|
||||
<raw-selector v-if="!preset.model && preset.advanced" v-model="preset.raw" class="mb-4" />
|
||||
<model-selector class="mb-4" />
|
||||
<ratio-selector class="mb-4" />
|
||||
<quality-selector class="mb-4" />
|
||||
<version-selector class="mb-4" />
|
||||
<translation-selector class="mb-4" />
|
||||
<advanced-selector class="mb-4" />
|
||||
<stylize-selector v-if="preset.advanced" class="mb-4" />
|
||||
<weird-selector v-if="preset.advanced" class="mb-4" />
|
||||
<chaos-selector v-if="preset.advanced" class="mb-4" />
|
||||
<image-weight-selector v-if="preset.advanced" class="mb-4" />
|
||||
<style-selector v-if="preset.advanced" class="mb-4" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -25,40 +24,28 @@ import ModelSelector from './preset/ModelSelector.vue';
|
||||
import QualitySelector from './preset/QualitySelector.vue';
|
||||
import ImageWeightSelector from './preset/ImageWeightSelector.vue';
|
||||
import WeirdSelector from './preset/WeirdSelector.vue';
|
||||
import RawSelector from './preset/RawSelector.vue';
|
||||
import AdvancedSelector from './preset/AdvancedSelector.vue';
|
||||
import TranslationSelector from './preset/TranslationSelector.vue';
|
||||
import NijiSelector from './preset/NijiSelector.vue';
|
||||
import StyleSelector from './preset/StyleSelector.vue';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PresetPanel',
|
||||
components: {
|
||||
ModelSelector,
|
||||
StyleSelector,
|
||||
QualitySelector,
|
||||
RatioSelector,
|
||||
VersionSelector,
|
||||
StylizeSelector,
|
||||
ChaosSelector,
|
||||
WeirdSelector,
|
||||
RawSelector,
|
||||
AdvancedSelector,
|
||||
ImageWeightSelector,
|
||||
TranslationSelector,
|
||||
NijiSelector
|
||||
TranslationSelector
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
preset: this.$store.state.midjourney.preset
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
preset: {
|
||||
handler(val) {
|
||||
this.$store.dispatch('midjourney/setPreset', {
|
||||
...val
|
||||
});
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
computed: {
|
||||
preset() {
|
||||
return this.$store.state.midjourney.preset;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<div>
|
||||
<h2 class="title">{{ $t('midjourney.name.prompt') }}</h2>
|
||||
<el-input v-model="value" :rows="3" type="textarea" :placeholder="$t('midjourney.placeholder.prompt')" />
|
||||
<p class="description">
|
||||
{{ $t('midjourney.description.prompt') }}
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -54,4 +57,9 @@ export default defineComponent({
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
.description {
|
||||
font-size: 12px;
|
||||
margin-top: 10px;
|
||||
color: var(--el-text-color-regular);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSwitch } from 'element-plus';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
|
||||
const DEFAULT_ADVANCED = false;
|
||||
|
||||
@@ -17,33 +16,24 @@ export default defineComponent({
|
||||
components: {
|
||||
ElSwitch
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.advanced;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set advanced', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
advanced: val
|
||||
});
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.value === undefined) {
|
||||
this.value = DEFAULT_ADVANCED;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -56,7 +46,7 @@ export default defineComponent({
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
|
||||
@@ -19,33 +19,24 @@ export default defineComponent({
|
||||
ElSlider,
|
||||
InfoIcon
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.chaos;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set quality', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
chaos: val
|
||||
});
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_CHAOS;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -58,7 +49,7 @@ export default defineComponent({
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
|
||||
@@ -19,33 +19,24 @@ export default defineComponent({
|
||||
ElSlider,
|
||||
InfoIcon
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.iw;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set iw', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
iw: val
|
||||
});
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_IW;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -58,7 +49,7 @@ export default defineComponent({
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
v-for="(option, optionKey) in options"
|
||||
:key="optionKey"
|
||||
:class="{ active: active === optionKey, item: true }"
|
||||
@click="
|
||||
active = optionKey;
|
||||
value = option.value;
|
||||
"
|
||||
@click="value = option.value"
|
||||
>
|
||||
<el-image :src="option.image" fit="cover" class="image" />
|
||||
<p class="name">
|
||||
@@ -23,22 +20,14 @@
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElImage } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ModelSelector',
|
||||
components: {
|
||||
ElImage
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue,
|
||||
active: 0,
|
||||
options: [
|
||||
{
|
||||
value: '',
|
||||
@@ -53,18 +42,27 @@ export default defineComponent({
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
}
|
||||
computed: {
|
||||
active() {
|
||||
return this.options.findIndex((option) => option.value === this.value);
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.model;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set model', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
model: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$emit('update:modelValue', this.value);
|
||||
if (this.value === undefined) {
|
||||
this.value = '';
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('midjourney.name.niji') }}</h2>
|
||||
<el-switch v-model="value" class="value" />
|
||||
<info-icon :content="$t('midjourney.description.niji')" class="info" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSwitch } from 'element-plus';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
|
||||
const DEFAULT_NIJI = false;
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RawSelector',
|
||||
components: {
|
||||
ElSwitch,
|
||||
InfoIcon
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.value === undefined) {
|
||||
this.value = DEFAULT_NIJI;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -21,17 +21,8 @@ export default defineComponent({
|
||||
ElRadioButton,
|
||||
ElRadioGroup
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue,
|
||||
active: 0,
|
||||
options: [
|
||||
{
|
||||
label: '低',
|
||||
@@ -48,21 +39,24 @@ export default defineComponent({
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.quality;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set quality', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
quality: val
|
||||
});
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_QUALITY;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -75,7 +69,7 @@ export default defineComponent({
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
v-for="(option, optionKey) in options"
|
||||
:key="optionKey"
|
||||
:class="{ active: active === optionKey, item: true }"
|
||||
@click="
|
||||
active = optionKey;
|
||||
value = option.value;
|
||||
"
|
||||
@click="value = option.value"
|
||||
>
|
||||
<div class="preview" :class="option.label">
|
||||
<div class="rect" :style="{ width: option.width + 'px', height: option.height + 'px' }"></div>
|
||||
@@ -29,16 +26,8 @@ const DEFAULT_RATIO = '1:1';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RatioSelector',
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue,
|
||||
options: [
|
||||
{
|
||||
value: '1:1',
|
||||
@@ -75,26 +64,25 @@ export default defineComponent({
|
||||
},
|
||||
computed: {
|
||||
active() {
|
||||
return this.options.findIndex((option) => option.value === this.value);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
}
|
||||
return this.options.findIndex((option) => option.value === this.value) || 0;
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.ratio;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set ratio', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
ratio: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.modelValue) {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_RATIO;
|
||||
} else {
|
||||
this.value = this.modelValue;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('midjourney.name.raw') }}</h2>
|
||||
<el-switch v-model="value" class="value" />
|
||||
<info-icon :content="$t('midjourney.description.raw')" class="info" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSwitch } from 'element-plus';
|
||||
import InfoIcon from '@/components/common/InfoIcon.vue';
|
||||
|
||||
const DEFAULT_RAW = false;
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RawSelector',
|
||||
components: {
|
||||
ElSwitch,
|
||||
InfoIcon
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.value === undefined) {
|
||||
this.value = DEFAULT_RAW;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('midjourney.name.style') }}</h2>
|
||||
<el-select v-model="value" class="value" :placeholder="$t('midjourney.placeholder.select')" clearable>
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
<span class="float-left">{{ item.label }}</span>
|
||||
<span class="float-right">{{ item.value }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
import model from '@/i18n/zh/midjourney/model';
|
||||
|
||||
const DEFAULT_STYLE = '';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'StyleSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
model() {
|
||||
return this.$store.state.midjourney.preset?.model;
|
||||
},
|
||||
options() {
|
||||
if (this.model === 'niji') {
|
||||
return [
|
||||
{
|
||||
value: 'cute',
|
||||
label: '可爱'
|
||||
},
|
||||
{
|
||||
value: 'expressive',
|
||||
label: '表现力'
|
||||
},
|
||||
{
|
||||
value: 'scenic',
|
||||
label: '场景'
|
||||
},
|
||||
{
|
||||
value: 'original',
|
||||
label: '原始'
|
||||
}
|
||||
];
|
||||
} else {
|
||||
return [
|
||||
{
|
||||
value: 'raw',
|
||||
label: '原生'
|
||||
}
|
||||
];
|
||||
}
|
||||
},
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.style;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set style', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
style: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
model() {
|
||||
this.value = '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_STYLE;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -19,33 +19,24 @@ export default defineComponent({
|
||||
ElSlider,
|
||||
InfoIcon
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.stylize;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set stylize', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
stylize: val
|
||||
});
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_STYLIZE;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -58,7 +49,7 @@ export default defineComponent({
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
|
||||
@@ -19,33 +19,24 @@ export default defineComponent({
|
||||
ElSwitch,
|
||||
InfoIcon
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Boolean,
|
||||
default: DEFAULT_TRANSLATION
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.translation;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set translation', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
translation: val
|
||||
});
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.value === undefined) {
|
||||
this.value = DEFAULT_TRANSLATION;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -58,7 +49,7 @@ export default defineComponent({
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('midjourney.name.version') }}</h2>
|
||||
<el-select v-model="value" class="value" placeholder="Select">
|
||||
<el-select v-model="value" class="value" :placeholder="$t('midjourney.placeholder.select')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -10,6 +10,7 @@
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
const DEFAULT_VERSION = '5.2';
|
||||
|
||||
export default defineComponent({
|
||||
@@ -27,8 +28,6 @@ export default defineComponent({
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue,
|
||||
active: 0,
|
||||
options: [
|
||||
{
|
||||
value: '6.0',
|
||||
@@ -65,21 +64,24 @@ export default defineComponent({
|
||||
]
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.version;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set version', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
version: val
|
||||
});
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_VERSION;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -92,7 +94,7 @@ export default defineComponent({
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
|
||||
@@ -19,33 +19,24 @@ export default defineComponent({
|
||||
ElSlider,
|
||||
InfoIcon
|
||||
},
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
emits: ['update:modelValue'],
|
||||
data() {
|
||||
return {
|
||||
value: this.modelValue
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
modelValue(val) {
|
||||
if (val !== this.value) {
|
||||
this.value = val;
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.midjourney.preset?.weird;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set weird', val);
|
||||
this.$store.commit('midjourney/setPreset', {
|
||||
...this.$store.state.midjourney.preset,
|
||||
weird: val
|
||||
});
|
||||
}
|
||||
},
|
||||
value(val) {
|
||||
this.$emit('update:modelValue', val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = DEFAULT_WEIRD;
|
||||
}
|
||||
this.$emit('update:modelValue', this.value);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -58,7 +49,7 @@ export default defineComponent({
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin-bottom: 0;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
aspect: '改变生成图像的宽高比例,默认值取决于模型和模式',
|
||||
chaos: '用于调整生成图像的变异程度,数字越大,生成的图像越独特和意想不到,范围为 0-100,默认为 1',
|
||||
chaos: '--chaos, 用于调整生成图像的变异程度,数字越大,生成的图像越独特和意想不到,范围为 0-100,默认为 1',
|
||||
fast: '忽略当前的设置,以快速模式运行单个生成任务,没有默认值',
|
||||
iw: '设置图像提示在生成过程中相对于文本提示的重要性,范围为 0-2,默认为 1',
|
||||
no: '指示生成系统尝试排除某些元素,例如 "--no plants" 将尝试生成不包含植物的图像,没有默认值',
|
||||
@@ -9,16 +9,16 @@ export default {
|
||||
'给提示添加一个随机的基础风格代码,可以使用 "--style random-16", "--style random-64" 或 "--style random-128" 来获取不同长度的随机风格效果,没有默认值',
|
||||
relax: '覆盖当前设置,让系统在放松模式下运行单个任务,没有默认值',
|
||||
repeat: '从一个提示创建多个任务,范围为 1-40,默认为 1',
|
||||
seed: '生成图像的起始视觉噪点,范围为 0-4294967295,默认为随机生成',
|
||||
seed: '--seed, 生成图像的起始视觉噪点,范围为 0-4294967295,默认为随机生成',
|
||||
stop: '在生成过程的任意阶段停止任务,范围为 10-100,默认为 100(即完全生成)',
|
||||
style:
|
||||
'切换 Midjourney 或 Niji 模型的不同版本或风格,例如 "raw", "4a", "4b", "4c", "cute", "expressive", "original", "scenic",默认值取决于模型和模式',
|
||||
stylize: '调整 Midjourney 默认美学风格在生成任务中的应用强度,范围为 0-1000,默认为 100',
|
||||
'--style, 切换 Midjourney 或 Niji 模型的不同版本或风格,例如 "raw", "cute", "expressive", "original", "scenic",默认值取决于模型和模式',
|
||||
stylize: '--stylize, 调整 Midjourney 默认美学风格在生成任务中的应用强度,范围为 0-1000,默认为 100',
|
||||
tile: '生成可以作为重复平铺使用的图像,以创建无缝的图案,没有默认值',
|
||||
turbo: '覆盖当前设置,以涡轮模式快速运行单个任务,没有默认值',
|
||||
weird: '探索带有实验性质的不常见美学风格,范围为 0-3000,默认为 0',
|
||||
weird: '--weird, 探索带有实验性质的不常见美学风格,范围为 0-3000,默认为 0',
|
||||
translation: '在生成过程中启用自动翻译,输入为非中文内容时会自动翻译为英文输入给 Midjourney',
|
||||
imageWeight: '调整图像提示相对于文本提示的权重,范围为 0-2,默认为 1',
|
||||
imageWeight: '--iw, 调整图像提示相对于文本提示的权重,范围为 0-2,默认为 1',
|
||||
niji: '启用此开关后,生成的图像将使用 Niji 模型,生成动漫风格的图片',
|
||||
uploadReferences: '上传图片作为生成的参考,支持最多 5 张图片。如果上传的图片数量超过 1 张,将会自动融合',
|
||||
raw: '启用此开关后,生成的图像将使用 Midjourney 模型,生成原始风格的图片',
|
||||
@@ -47,5 +47,6 @@ export default {
|
||||
upsample_4x: '放大 4 倍',
|
||||
redo_upsample_2x: '重新放大 2 倍',
|
||||
redo_upsample_4x: '重新放大 4 倍',
|
||||
download: '下载'
|
||||
download: '下载',
|
||||
prompt: '输入指令如果添加额外参数,其会覆盖默认预设参数,如添加 --stylize 200,最终指令会强制使用 --stylize 200'
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export default {
|
||||
promptPlaceholder: '请输入一句话来描述你想要生成的图片,例如:一只好看的猫',
|
||||
promptPlaceholder: '请输入一句话来描述你想要生成的图片,例如:一只好看的猫。额外的参数会覆盖默认预设参数',
|
||||
uploadReferencesExceed: '最多只能上传 5 张图片',
|
||||
uploadReferencesError: '上传图片失败,请稍后重试',
|
||||
startTaskSuccess: '发起绘图任务成功',
|
||||
|
||||
@@ -4,6 +4,7 @@ export default {
|
||||
ratio: '宽高比',
|
||||
chaos: '混乱度',
|
||||
fast: '快速模式',
|
||||
nijiStyle: '动漫风格',
|
||||
version: '版本',
|
||||
imageWeight: '图像权重',
|
||||
no: '否定提示',
|
||||
@@ -13,7 +14,7 @@ export default {
|
||||
repeat: '重复生成',
|
||||
seed: '种子数',
|
||||
stop: '提前停止',
|
||||
style: '风格切换',
|
||||
style: '风格',
|
||||
stylize: '风格化度',
|
||||
tile: '平铺模式',
|
||||
turbo: '涡轮模式',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export default {
|
||||
prompt: '请输入一句话来描述你想要生成的图片,例如:一只好看的猫',
|
||||
ignore: '不想让图像中出现的内容,例如生成一幅街景,但不要有汽车,你可以填写:汽车'
|
||||
ignore: '不想让图像中出现的内容,例如生成一幅街景,但不要有汽车,你可以填写:汽车',
|
||||
select: '选择'
|
||||
};
|
||||
|
||||
@@ -14,8 +14,8 @@ export interface IMidjourneyPreset {
|
||||
advanced?: boolean;
|
||||
quality?: string;
|
||||
weird?: number;
|
||||
raw?: boolean;
|
||||
iw?: number;
|
||||
style?: string;
|
||||
translation?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,35 +119,35 @@ export default defineComponent({
|
||||
if (this.elements.length > 0) {
|
||||
content += ',' + this.elements.join(',');
|
||||
}
|
||||
if (this.preset.model) {
|
||||
if (this.preset.model && !content.includes(`--${this.preset.model}`)) {
|
||||
content += ` --${this.preset.model}`;
|
||||
}
|
||||
if (this.preset.version) {
|
||||
if (this.preset.version && !content.includes(`--version `) && !content.includes(`--v `)) {
|
||||
content += ` --version ${this.preset.version}`;
|
||||
}
|
||||
if (this.preset.chaos) {
|
||||
if (this.preset.chaos && !content.includes(`--chaos `)) {
|
||||
content += ` --chaos ${this.preset.chaos}`;
|
||||
}
|
||||
if (this.preset.quality) {
|
||||
if (this.preset.quality && !content.includes(`--quality `) && !content.includes(`--q `)) {
|
||||
content += ` --quality ${this.preset.quality}`;
|
||||
}
|
||||
if (this.preset.ratio) {
|
||||
content += ` --ar ${this.preset.ratio}`;
|
||||
if (this.preset.ratio && !content.includes(`--aspect `) && !content.includes(`--ar `)) {
|
||||
content += ` --aspect ${this.preset.ratio}`;
|
||||
}
|
||||
if (this.preset.stylize) {
|
||||
if (this.preset.stylize && !content.includes(`--stylize `) && !content.includes(`--s `)) {
|
||||
content += ` --stylize ${this.preset.stylize}`;
|
||||
}
|
||||
if (this.preset.weird) {
|
||||
if (this.preset.weird && !content.includes(`--weird `) && !content.includes(`--w `)) {
|
||||
content += ` --weird ${this.preset.weird}`;
|
||||
}
|
||||
if (this.ignore) {
|
||||
if (this.ignore && !content.includes(`--no `)) {
|
||||
content += ` --no ${this.ignore}`;
|
||||
}
|
||||
if (this.preset.iw) {
|
||||
if (this.preset.iw && !content.includes(`--iw `)) {
|
||||
content += ` --iw ${this.preset.iw}`;
|
||||
}
|
||||
if (this.preset.raw) {
|
||||
content += ` --style raw`;
|
||||
if (this.preset.style && !content.includes(`--style`)) {
|
||||
content += ` --style ${this.preset.style}`;
|
||||
}
|
||||
return this.prompt || this.references?.length > 0 ? content : '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user