Skip to content

Commit

Permalink
update exp
Browse files Browse the repository at this point in the history
  • Loading branch information
Germey committed Dec 17, 2023
1 parent 14f6436 commit 488ed69
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 24 deletions.
4 changes: 4 additions & 0 deletions src/components/midjourney/ElementsSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2118,6 +2118,10 @@ export default defineComponent({
</script>

<style lang="scss" scoped>
.title {
font-size: 14px;
margin-bottom: 10px;
}
.pane {
display: flex;
flex-direction: row;
Expand Down
9 changes: 4 additions & 5 deletions src/components/midjourney/IgnoreSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ export default defineComponent({
</script>

<style lang="scss" scoped>
.title {
font-size: 14px;
margin-bottom: 10px;
}
.field {
display: flex;
flex-direction: row;
align-items: center;
.title {
font-size: 14px;
margin-bottom: 0;
width: 30%;
}
.value {
flex: 1;
}
Expand Down
9 changes: 4 additions & 5 deletions src/components/midjourney/PromptInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ export default defineComponent({
</script>

<style lang="scss" scoped>
.title {
font-size: 14px;
margin-bottom: 10px;
}
.field {
display: flex;
flex-direction: row;
align-items: center;
.title {
font-size: 14px;
margin-bottom: 0;
width: 30%;
}
.value {
flex: 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/midjourney/preset/ImageWeightSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { defineComponent } from 'vue';
import { ElSlider } from 'element-plus';
import InfoIcon from '@/components/common/InfoIcon.vue';
const DEFAULT_IW = 1;
const DEFAULT_IW = 1.0;
export default defineComponent({
name: 'ImageWeightSelector',
Expand Down
4 changes: 2 additions & 2 deletions src/components/midjourney/preset/ModelSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export default defineComponent({
options: [
{
value: '',
label: '通用',
label: this.$t('midjourney.model.general'),
image: 'https://cdn.zhishuyun.com/2023-10-06-174633.png'
},
{
value: 'niji',
label: '动漫',
label: this.$t('midjourney.model.niji'),
image: 'https://cdn.zhishuyun.com/2023-10-06-174008.png'
}
]
Expand Down
16 changes: 11 additions & 5 deletions src/components/midjourney/tasks/TaskPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
</p>
</div>
<p v-show="false" class="description">{{ $t('midjourney.field.taskId') }}: {{ modelValue?.id }}</p>
<div v-if="!modelValue?.response" class="content">
<div v-if="!modelValue?.response" :class="{ content: true, full: !!full }">
<el-image class="image">
<template #error>
<div class="image-slot">{{ $t('midjourney.message.generating') }}</div>
</template>
</el-image>
</div>
<div v-else-if="modelValue?.response.success === false" class="content failed">
<div v-else-if="modelValue?.response.success === false" :class="{ content: true, full: full, failed: true }">
<el-image class="image">
<template #error>
<div class="image-slot">{{ modelValue?.response?.detail }}</div>
</template>
</el-image>
</div>
<div v-else class="content">
<div v-else :class="{ content: true, full: full }">
<el-image
v-if="modelValue?.response?.image_url"
:src="modelValue?.response?.image_url"
Expand Down Expand Up @@ -277,20 +277,26 @@ export default defineComponent({
}
.content {
width: 100%;
height: 318px;
position: relative;
margin-bottom: 10px;
&.full {
height: 318px;
.image {
min-height: 200px;
}
}
&.failed {
.image {
.image-slot {
font-size: 16px;
padding: 20px;
}
}
}
.image {
width: 100%;
height: 100%;
min-height: 200px;
min-height: 100px;
.image-slot {
display: flex;
justify-content: center;
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/zh/midjourney/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import message from './message';
import placeholder from './placeholder';
import button from './button';
import field from './field';
import model from './model';

export default { description, name, message, placeholder, button, field };
export default { description, name, message, placeholder, button, field, model };
4 changes: 4 additions & 0 deletions src/i18n/zh/midjourney/model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
general: '通用',
niji: '动漫'
};
4 changes: 2 additions & 2 deletions src/pages/midjourney/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ export default defineComponent({
path
})
.then(() => {
ElMessage.info(this.$t('midjourney.message.startTaskSuccess'));
ElMessage.success(this.$t('midjourney.message.startTaskSuccess'));
})
.catch(() => {
ElMessage.info(this.$t('midjourney.message.startTaskFailed'));
ElMessage.error(this.$t('midjourney.message.startTaskFailed'));
});
},
async onCustom(payload: { image_id: string; action: MidjourneyImagineAction }) {
Expand Down
6 changes: 3 additions & 3 deletions src/pages/midjourney/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default defineComponent({
content += ` --iw ${this.preset.iw}`;
}
if (this.preset.raw) {
content += ` --raw`;
content += ` --style raw`;
}
return this.prompt || this.references?.length > 0 ? content : '';
}
Expand Down Expand Up @@ -176,10 +176,10 @@ export default defineComponent({
path
})
.then(() => {
ElMessage.info(this.$t('midjourney.message.startTaskSuccess'));
ElMessage.success(this.$t('midjourney.message.startTaskSuccess'));
})
.catch(() => {
ElMessage.info(this.$t('midjourney.message.startTaskFailed'));
ElMessage.error(this.$t('midjourney.message.startTaskFailed'));
});
},
async onCustom(payload: { image_id: string; action: MidjourneyImagineAction }) {
Expand Down

0 comments on commit 488ed69

Please sign in to comment.