feat: midjourney image variation function is ready

This commit is contained in:
RockYang
2023-08-15 17:31:02 +08:00
parent 113769791f
commit e65c32c4c7
7 changed files with 95 additions and 26 deletions

View File

@@ -92,14 +92,23 @@ watch(() => props.content, (newVal) => {
});
const emits = defineEmits(['disable-input', 'disable-input']);
const upscale = (index) => {
send('/api/mj/upscale', index)
}
const variation = (index) => {
send('/api/mj/variation', index)
}
const send = (url, index) => {
loading.value = true
emits('disable-input')
httpPost("/api/mj/upscale", {
httpPost(url, {
index: index,
message_id: data.value?.["message_id"],
message_hash: data.value?.["image"]?.hash,
session_id: getSessionId(),
key: data.value?.["key"]
key: data.value?.["key"],
prompt: data.value?.["prompt"],
}).then(() => {
ElMessage.success("任务推送成功,请耐心等待任务执行...")
loading.value = false
@@ -108,10 +117,6 @@ const upscale = (index) => {
emits('disable-input')
})
}
const variation = (index) => {
ElMessage.warning("当前版本暂未实现 Variation 功能!")
}
</script>
<style lang="stylus">