Improve midjourney experience (#45)

This commit is contained in:
AceDataCloud committed 2024-01-08 17:47:24 +00:00
1 parent 7fe2186a18
commit 63299dd440
23 files changed
+295 -396

No files matched your search

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