diff --git a/components.d.ts b/components.d.ts index cbf39d5..6178c47 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,19 +11,10 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { - 2: typeof import('./src/components/virtual-scroller/VirtualScroller copy 2.vue')['default'] - 3: typeof import('./src/components/virtual-scroller/VirtualScroller copy 3.vue')['default'] Canvas: typeof import('./src/components/canvas/index.vue')['default'] - copy: typeof import('./src/components/virtual-scroller/VirtualScroller copy.vue')['default'] DialogBox: typeof import('./src/components/dialogBox/index.vue')['default'] - Dimension: typeof import('./src/components/dialogBox/dimension/index.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] - ElInput: typeof import('element-plus/es')['ElInput'] - ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] - ElOption: typeof import('element-plus/es')['ElOption'] - ElSelect: typeof import('element-plus/es')['ElSelect'] - ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElUpload: typeof import('element-plus/es')['ElUpload'] IEpCalendar: typeof import('~icons/ep/calendar')['default'] @@ -32,19 +23,11 @@ declare module 'vue' { IEpLoading: typeof import('~icons/ep/loading')['default'] IEpPlus: typeof import('~icons/ep/plus')['default'] IEpStar: typeof import('~icons/ep/star')['default'] - ImageUploader: typeof import('./src/components/dialogBox/imageUploader/index.vue')['default'] Img: typeof import('./src/components/Img/index.vue')['default'] - Painting: typeof import('./src/components/dialogBox/model/painting.vue')['default'] - ParamControl: typeof import('./src/components/dialogBox/ParamControl.vue')['default'] - Pattern: typeof import('./src/components/dialogBox/pattern/index.vue')['default'] Popover: typeof import('./src/components/Popover/index.vue')['default'] - Quantity: typeof import('./src/components/dialogBox/quantity/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] Select: typeof import('./src/components/Select/index.vue')['default'] - Time: typeof import('./src/components/dialogBox/Time/index.vue')['default'] - Video: typeof import('./src/components/dialogBox/model/video.vue')['default'] - VideoImageUploader: typeof import('./src/components/dialogBox/videoImageUploader/index.vue')['default'] VirtualScroller: typeof import('./src/components/virtual-scroller/VirtualScroller.vue')['default'] 'VirtualScroller copy': typeof import('./src/components/virtual-scroller/VirtualScroller copy.vue')['default'] } diff --git a/src/components/dialogBox/Time/index.vue b/src/components/dialogBox/Time/index.vue deleted file mode 100644 index 7acfe1a..0000000 --- a/src/components/dialogBox/Time/index.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - 选择视频生成时长 - - - - - - - diff --git a/src/components/dialogBox/dimension/index.vue b/src/components/dialogBox/dimension/index.vue deleted file mode 100644 index 1a70538..0000000 --- a/src/components/dialogBox/dimension/index.vue +++ /dev/null @@ -1,247 +0,0 @@ - - - - - 尺寸 (px) - - - W - - - - - {{ isLocked ? '解绑比例' : '约束比例' }} - - - H - - - - - - - - - {{ displayText }} - - - - - - - - diff --git a/src/components/dialogBox/imageUploader/index.vue b/src/components/dialogBox/imageUploader/index.vue deleted file mode 100644 index 3c793a9..0000000 --- a/src/components/dialogBox/imageUploader/index.vue +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - {{ index + 1 }} - - - - - - - 参考内容 - - - - - - - - - diff --git a/src/components/dialogBox/model/painting.vue b/src/components/dialogBox/model/painting.vue deleted file mode 100644 index ddb0b77..0000000 --- a/src/components/dialogBox/model/painting.vue +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - - - - diff --git a/src/components/dialogBox/model/video.vue b/src/components/dialogBox/model/video.vue deleted file mode 100644 index 7fa0dee..0000000 --- a/src/components/dialogBox/model/video.vue +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - - diff --git a/src/components/dialogBox/pattern/index.vue b/src/components/dialogBox/pattern/index.vue deleted file mode 100644 index 2ad910d..0000000 --- a/src/components/dialogBox/pattern/index.vue +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - {{ option.labelText }} - - - - - - - - diff --git a/src/components/dialogBox/proportion/painting.vue b/src/components/dialogBox/proportion/painting.vue deleted file mode 100644 index a24369b..0000000 --- a/src/components/dialogBox/proportion/painting.vue +++ /dev/null @@ -1,465 +0,0 @@ - - - - - 选择比例 - - - {{ item.label }} - - - - - - 选择分辨率 - - - {{ item.label }} - - - - - - 尺寸(px) - - - W - - - - - {{ isLocked ? '解绑比例' : '约束比例' }} - - - H - - - - - - - - - {{ proportion }} - - - - - - - - diff --git a/src/components/dialogBox/proportion/video.vue b/src/components/dialogBox/proportion/video.vue deleted file mode 100644 index 0aeafae..0000000 --- a/src/components/dialogBox/proportion/video.vue +++ /dev/null @@ -1,242 +0,0 @@ - - - - - 选择比例 - - - {{ item.label }} - - - - - - 选择分辨率 - - - {{ item.label }} - - - - - - - - {{ proportion }} - - {{ resolution }} - - - - - - - - diff --git a/src/components/dialogBox/quantity/index.vue b/src/components/dialogBox/quantity/index.vue deleted file mode 100644 index 9ecb2af..0000000 --- a/src/components/dialogBox/quantity/index.vue +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - diff --git a/src/components/dialogBox/videoImageUploader/index.vue b/src/components/dialogBox/videoImageUploader/index.vue deleted file mode 100644 index 4c7c708..0000000 --- a/src/components/dialogBox/videoImageUploader/index.vue +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - {{ getFrameLabel(index) }} - - - - - - - - {{ getUploadText(i) }} - - - - - - - - - - diff --git a/src/config/index.js b/src/config/index.js deleted file mode 100644 index 762d221..0000000 --- a/src/config/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import * as runninghub from './runninghub/index.js' -// import * as suno from './suno.js' - -export default { runninghub } \ No newline at end of file diff --git a/src/config/runninghub/index.js b/src/config/runninghub/index.js deleted file mode 100644 index 9d1c750..0000000 --- a/src/config/runninghub/index.js +++ /dev/null @@ -1,113 +0,0 @@ -import { fetchModelConfig } from '@/utils/modelConfig' - -function getWidthHeight({ proportion, resolution }) { - let baseSize - switch (resolution) { - case '1k': - baseSize = 1024 - break - case '2k': - baseSize = 2048 - break - case '4k': - baseSize = 4096 - break - default: - baseSize = 2048 - } - - if (proportion === '智能') { - return { width: baseSize, height: baseSize } - } - - const [w, h] = String(proportion).split(':').map(Number) - const aspectRatio = w / h - - if (aspectRatio > 1) { - return { - width: baseSize, - height: Math.round(baseSize / aspectRatio) - } - } else { - return { - height: baseSize, - width: Math.round(baseSize * aspectRatio) - } - } -} - -export async function Playload(data) { - try { - const json = await fetchModelConfig(data.type, data.modelName, data.modelType) - - const nodeInfoList = [] - const proportionParam = data.params.find(param => param.name === 'proportion') || {data: 0} - const resolutionParam = data.params.find(param => param.name === 'resolution') || {data: 0} - - if (Array.isArray(data.imgs) && data.imgs.length > 0 && (data.modelType === 'image' || data.modelType === 'edit')) { - for (const key of data.imgs) { - if (json.nodeInfoList[key.name]) { - console.log(key) - json.nodeInfoList[key.name].fieldValue = key.url - nodeInfoList.push(json.nodeInfoList[key.name]) - } - if (json.imageIndex && json.imageIndex[key.name]) { - json.imageIndex[key.name].fieldValue = key.index - nodeInfoList.push(json.imageIndex[key.name]) - } - } - if (json.nodeInfoList.index) { - json.nodeInfoList.index.fieldValue = data.imgs.length - 1 - } - } - - if (Array.isArray(data.params)) { - for (const key of data.params) { - if (json.nodeInfoList[key.name]) { - console.log(key) - json.nodeInfoList[key.name].fieldValue = key.data - nodeInfoList.push(json.nodeInfoList[key.name]) - } - } - } - - if ((json.nodeInfoList.width || json.nodeInfoList.height) && (proportionParam.data && resolutionParam.data)) { - const { width, height } = getWidthHeight({ - proportion: proportionParam.data, - resolution: resolutionParam.data - }) - json.nodeInfoList.width.fieldValue = width - json.nodeInfoList.height.fieldValue = height - nodeInfoList.push(json.nodeInfoList.width, json.nodeInfoList.height) - } - - if (Array.isArray(json.seed)) { - const min = Math.pow(10, 0) - const max = Math.pow(10, 9) - 1 - const randomNum = Math.floor(Math.random() * (max - min + 1)) + min - json.seed.map((seedItem) => { - seedItem.fieldValue = randomNum - nodeInfoList.push(seedItem) - }) - } - - if (Array.isArray(json.must)) { - nodeInfoList.push(...json.must) - } - - return { - workflowId: json.workflowId, - nodeInfoList - } - } catch (error) { - console.error('获取 JSON 文件失败:', error) - throw error - } -} - -export function result(result) { - if (result.code === 0 && result.msg === 'success') { - return { type: true, url: result.data[0].fileUrl } - } - return { type: false, message: result.data.exception_message } -} diff --git a/src/platforms/painting/index.js b/src/platforms/painting/index.js index c99e0c3..9bbc56d 100644 --- a/src/platforms/painting/index.js +++ b/src/platforms/painting/index.js @@ -1,6 +1,6 @@ import { ref, reactive, markRaw } from 'vue' import { fetchPlatformModels, getPlatformCode } from '@/utils/modelApi' -import { getModelConfig } from '@/config/models/index.js' +import { getModelConfig } from './models/index.js' import PaintingModelSelector from './modelSelector.vue' import PaintingProportion from './controls/proportion.vue' import DimensionInput from './controls/dimension.vue' diff --git a/src/platforms/painting/modelSelector.vue b/src/platforms/painting/modelSelector.vue index ddb0b77..99e1c2a 100644 --- a/src/platforms/painting/modelSelector.vue +++ b/src/platforms/painting/modelSelector.vue @@ -14,7 +14,7 @@