diff --git a/src/api/home.ts b/src/api/home.ts index 1c47110..f9b69b0 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -35,3 +35,5 @@ export const getWorks = (params: Type.Object = {}) => fetch('design/poster', par // 作品列表 export const getMyDesign = (params: Type.Object = {}) => fetch('design/my', params, 'get') + +export const test = (params: Type.Object = {}) => fetch('https://res.palxp.com/api/upload', params, 'post') diff --git a/src/components/business/image-cutout/ImageCutout.vue b/src/components/business/image-cutout/ImageCutout.vue index 4d39672..ed6987b 100644 --- a/src/components/business/image-cutout/ImageCutout.vue +++ b/src/components/business/image-cutout/ImageCutout.vue @@ -36,8 +36,6 @@ import { defineComponent, reactive, toRefs, onMounted, nextTick } from 'vue' import { useStore } from 'vuex' import { UploadFilled } from '@element-plus/icons-vue' -// import { client } from '@gradio/client' -// import * as api from '@/api/ai' import uploader from '@/components/common/Uploader/index.vue' import _dl from '@/common/methods/download' @@ -73,11 +71,7 @@ export default defineComponent({ state.rawImage = URL.createObjectURL(file) fileName = file.name // 返回抠图 - const result = await app.predict('/predict', [ - file, // blob in 'Input' Image component - 'u2netp', // string (Option from: ['isnet-anime', 'isnet-general-use', 'sam', 'silueta', 'u2net', 'u2net_cloth_seg', 'u2net_custom', 'u2net_human_seg', 'u2netp']) in 'Models' Dropdown component - '', - ]) + const result = await app.predict('/predict', [file, 'u2netp', '']) state.rawImage && (state.cutImage = result?.data[0]) requestAnimationFrame(run) } diff --git a/src/views/Draw.vue b/src/views/Draw.vue index d8f6307..db5ff08 100644 --- a/src/views/Draw.vue +++ b/src/views/Draw.vue @@ -49,7 +49,6 @@ export default defineComponent({ const content = JSON.parse(data) content.page.backgroundImage && content.page.backgroundImage.split('.')[1] === 'palxp' && (content.page.backgroundImage += '@small') - this.compressImages(content.widgets) this.$store.commit('setDPage', content.page) id ? this.$store.commit('setDWidgets', content.widgets) : this.setTemplate(content.widgets) await this.$nextTick() @@ -149,14 +148,6 @@ export default defineComponent({ }) }) }, - compressImages(widgets: any) { - // 自用 - for (const item of widgets) { - if (item.imgUrl && item.imgUrl.split('.')[item.imgUrl.split('.').length - 1] === 'png') { - item.imgUrl.split('.')[1] === 'palxp' && (item.imgUrl += '@small') - } - } - }, }, }) diff --git a/src/views/Psd.vue b/src/views/Psd.vue index ea1fbef..de89fbd 100644 --- a/src/views/Psd.vue +++ b/src/views/Psd.vue @@ -10,9 +10,9 @@