From 004db347fec20186785d66261222eef418c4c0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BE=B7=E8=BE=89?= Date: Tue, 1 Jul 2025 15:31:41 +0800 Subject: [PATCH] fix --- package.json | 6 +- scripts/generate-api.js | 2 +- src/api/index.ts | 19 +- src/api/models/BatchImageEditData.ts | 9 - ..._edit_image_api_async_custom_image_post.ts | 8 - ...t_task_api_comfy_async_submit_task_post.ts | 10 - ...h_bg_opt_api_local_batch_change_bg_post.ts | 9 - ...sync_change_bg_api_local_change_bg_post.ts | 9 - ...n_images_api_v2_local_batch_images_post.ts | 24 --- ...ge_bg_api_v2_cloud_batch_change_bg_post.ts | 12 ++ ...ges_api_v2_cloud_batch_edit_images_post.ts | 20 ++ src/api/models/ImageEditItem.ts | 11 -- src/api/models/VideoDataResponse.ts | 16 +- src/api/models/index.ts | 9 +- src/api/schemas/$BatchImageEditData.ts | 15 -- ..._edit_image_api_async_custom_image_post.ts | 13 -- ...t_task_api_comfy_async_submit_task_post.ts | 20 -- ...sync_change_bg_api_local_change_bg_post.ts | 19 -- ...e_bg_api_v2_cloud_batch_change_bg_post.ts} | 11 +- ...es_api_v2_cloud_batch_edit_images_post.ts} | 15 +- src/api/schemas/$ImageEditItem.ts | 24 --- src/api/schemas/$VideoDataResponse.ts | 58 +++++- src/api/services/ComfyService.ts | 121 ------------ src/api/services/DefaultService.ts | 176 ++++++++---------- src/api/services/Service.ts | 30 ++- src/api/services/WebhookService.ts | 1 + src/api/services/index.ts | 1 - 27 files changed, 211 insertions(+), 457 deletions(-) delete mode 100644 src/api/models/BatchImageEditData.ts delete mode 100644 src/api/models/Body_async_custom_edit_image_api_async_custom_image_post.ts delete mode 100644 src/api/models/Body_handler_submit_task_api_comfy_async_submit_task_post.ts delete mode 100644 src/api/models/Body_local_async_batch_bg_opt_api_local_batch_change_bg_post.ts delete mode 100644 src/api/models/Body_local_async_change_bg_api_local_change_bg_post.ts delete mode 100644 src/api/models/Body_local_async_gen_images_api_v2_local_batch_images_post.ts create mode 100644 src/api/models/Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post.ts create mode 100644 src/api/models/Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post.ts delete mode 100644 src/api/models/ImageEditItem.ts delete mode 100644 src/api/schemas/$BatchImageEditData.ts delete mode 100644 src/api/schemas/$Body_async_custom_edit_image_api_async_custom_image_post.ts delete mode 100644 src/api/schemas/$Body_handler_submit_task_api_comfy_async_submit_task_post.ts delete mode 100644 src/api/schemas/$Body_local_async_change_bg_api_local_change_bg_post.ts rename src/api/schemas/{$Body_local_async_batch_bg_opt_api_local_batch_change_bg_post.ts => $Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post.ts} (60%) rename src/api/schemas/{$Body_local_async_gen_images_api_v2_local_batch_images_post.ts => $Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post.ts} (58%) delete mode 100644 src/api/schemas/$ImageEditItem.ts delete mode 100644 src/api/services/ComfyService.ts diff --git a/package.json b/package.json index 53bcf05..d76085c 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ "build": "tsc -b && vite build", "lint": "eslint .", "preview": "vite preview", - "generate-api": "node scripts/generate-api.js", - "generate-api:dev": "OPENAPI_URL=http://localhost:3000/openapi.json node scripts/generate-api.js", - "generate-api:prod": "OPENAPI_URL=https://your-api-domain.com/openapi.json node scripts/generate-api.js" + "api": "node scripts/generate-api.js", + "api:dev": "OPENAPI_URL=http://localhost:3000/openapi.json node scripts/generate-api.js", + "api:prod": "OPENAPI_URL=https://your-api-domain.com/openapi.json node scripts/generate-api.js" }, "dependencies": { "@hookform/resolvers": "^5.1.1", diff --git a/scripts/generate-api.js b/scripts/generate-api.js index 509f60e..c3a4ddc 100644 --- a/scripts/generate-api.js +++ b/scripts/generate-api.js @@ -5,7 +5,7 @@ import axios from 'axios'; // 配置 const config = { - input: process.env.OPENAPI_URL || 'http://192.168.0.127:8010/openapi.json', // OpenAPI规范URL + input: process.env.OPENAPI_URL || 'https://bowongai--glam-api-fastapi-app.modal.run/openapi.json', // OpenAPI规范URL output: './src/api', // 生成的API代码输出目录 client: 'axios', // 使用axios作为HTTP客户端 useOptions: true, diff --git a/src/api/index.ts b/src/api/index.ts index e3286c2..da857f3 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,20 +7,15 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise'; export { OpenAPI } from './core/OpenAPI'; export type { OpenAPIConfig } from './core/OpenAPI'; -export type { BatchImageEditData } from './models/BatchImageEditData'; export type { BatchVideoTaskRequest } from './models/BatchVideoTaskRequest'; -export type { Body_async_custom_edit_image_api_async_custom_image_post } from './models/Body_async_custom_edit_image_api_async_custom_image_post'; export type { Body_create_model_api_models_create_post } from './models/Body_create_model_api_models_create_post'; -export type { Body_handler_submit_task_api_comfy_async_submit_task_post } from './models/Body_handler_submit_task_api_comfy_async_submit_task_post'; -export type { Body_local_async_batch_bg_opt_api_local_batch_change_bg_post } from './models/Body_local_async_batch_bg_opt_api_local_batch_change_bg_post'; -export type { Body_local_async_change_bg_api_local_change_bg_post } from './models/Body_local_async_change_bg_api_local_change_bg_post'; export type { Body_local_async_change_bg_api_v2_local_batch_change_bg_post } from './models/Body_local_async_change_bg_api_v2_local_batch_change_bg_post'; export type { Body_local_async_gen_images_api_v2_local_batch_edit_images_post } from './models/Body_local_async_gen_images_api_v2_local_batch_edit_images_post'; -export type { Body_local_async_gen_images_api_v2_local_batch_images_post } from './models/Body_local_async_gen_images_api_v2_local_batch_images_post'; +export type { Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post } from './models/Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post'; +export type { Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post } from './models/Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post'; export type { Body_update_model_api_models__model_id__put } from './models/Body_update_model_api_models__model_id__put'; export type { Body_upload_image_api_upload_post } from './models/Body_upload_image_api_upload_post'; export type { HTTPValidationError } from './models/HTTPValidationError'; -export type { ImageEditItem } from './models/ImageEditItem'; export type { PaginationResponse } from './models/PaginationResponse'; export type { TaskQueryRequest } from './models/TaskQueryRequest'; export type { UploadResponse } from './models/UploadResponse'; @@ -30,20 +25,15 @@ export type { VideoDataResponse } from './models/VideoDataResponse'; export type { VideoTaskRequest } from './models/VideoTaskRequest'; export type { VideoTaskStatus } from './models/VideoTaskStatus'; -export { $BatchImageEditData } from './schemas/$BatchImageEditData'; export { $BatchVideoTaskRequest } from './schemas/$BatchVideoTaskRequest'; -export { $Body_async_custom_edit_image_api_async_custom_image_post } from './schemas/$Body_async_custom_edit_image_api_async_custom_image_post'; export { $Body_create_model_api_models_create_post } from './schemas/$Body_create_model_api_models_create_post'; -export { $Body_handler_submit_task_api_comfy_async_submit_task_post } from './schemas/$Body_handler_submit_task_api_comfy_async_submit_task_post'; -export { $Body_local_async_batch_bg_opt_api_local_batch_change_bg_post } from './schemas/$Body_local_async_batch_bg_opt_api_local_batch_change_bg_post'; -export { $Body_local_async_change_bg_api_local_change_bg_post } from './schemas/$Body_local_async_change_bg_api_local_change_bg_post'; export { $Body_local_async_change_bg_api_v2_local_batch_change_bg_post } from './schemas/$Body_local_async_change_bg_api_v2_local_batch_change_bg_post'; export { $Body_local_async_gen_images_api_v2_local_batch_edit_images_post } from './schemas/$Body_local_async_gen_images_api_v2_local_batch_edit_images_post'; -export { $Body_local_async_gen_images_api_v2_local_batch_images_post } from './schemas/$Body_local_async_gen_images_api_v2_local_batch_images_post'; +export { $Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post } from './schemas/$Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post'; +export { $Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post } from './schemas/$Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post'; export { $Body_update_model_api_models__model_id__put } from './schemas/$Body_update_model_api_models__model_id__put'; export { $Body_upload_image_api_upload_post } from './schemas/$Body_upload_image_api_upload_post'; export { $HTTPValidationError } from './schemas/$HTTPValidationError'; -export { $ImageEditItem } from './schemas/$ImageEditItem'; export { $PaginationResponse } from './schemas/$PaginationResponse'; export { $TaskQueryRequest } from './schemas/$TaskQueryRequest'; export { $UploadResponse } from './schemas/$UploadResponse'; @@ -54,6 +44,5 @@ export { $VideoTaskRequest } from './schemas/$VideoTaskRequest'; export { $VideoTaskStatus } from './schemas/$VideoTaskStatus'; export { Service } from './services/Service'; -export { ComfyService } from './services/ComfyService'; export { DefaultService } from './services/DefaultService'; export { WebhookService } from './services/WebhookService'; diff --git a/src/api/models/BatchImageEditData.ts b/src/api/models/BatchImageEditData.ts deleted file mode 100644 index 810c3b1..0000000 --- a/src/api/models/BatchImageEditData.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ImageEditItem } from './ImageEditItem'; -export type BatchImageEditData = { - tasks: Array; -}; - diff --git a/src/api/models/Body_async_custom_edit_image_api_async_custom_image_post.ts b/src/api/models/Body_async_custom_edit_image_api_async_custom_image_post.ts deleted file mode 100644 index 37815ae..0000000 --- a/src/api/models/Body_async_custom_edit_image_api_async_custom_image_post.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Body_async_custom_edit_image_api_async_custom_image_post = { - img_path: Blob; -}; - diff --git a/src/api/models/Body_handler_submit_task_api_comfy_async_submit_task_post.ts b/src/api/models/Body_handler_submit_task_api_comfy_async_submit_task_post.ts deleted file mode 100644 index 189e824..0000000 --- a/src/api/models/Body_handler_submit_task_api_comfy_async_submit_task_post.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Body_handler_submit_task_api_comfy_async_submit_task_post = { - prompt: string; - edit_image: Blob; - aspect_ratio?: string; -}; - diff --git a/src/api/models/Body_local_async_batch_bg_opt_api_local_batch_change_bg_post.ts b/src/api/models/Body_local_async_batch_bg_opt_api_local_batch_change_bg_post.ts deleted file mode 100644 index 4e3725e..0000000 --- a/src/api/models/Body_local_async_batch_bg_opt_api_local_batch_change_bg_post.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Body_local_async_batch_bg_opt_api_local_batch_change_bg_post = { - clothing_images: Array; - scenario_categories?: Array; -}; - diff --git a/src/api/models/Body_local_async_change_bg_api_local_change_bg_post.ts b/src/api/models/Body_local_async_change_bg_api_local_change_bg_post.ts deleted file mode 100644 index 8572495..0000000 --- a/src/api/models/Body_local_async_change_bg_api_local_change_bg_post.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Body_local_async_change_bg_api_local_change_bg_post = { - clothing_image: Blob; - scenario_categories?: Array; -}; - diff --git a/src/api/models/Body_local_async_gen_images_api_v2_local_batch_images_post.ts b/src/api/models/Body_local_async_gen_images_api_v2_local_batch_images_post.ts deleted file mode 100644 index 8d81ada..0000000 --- a/src/api/models/Body_local_async_gen_images_api_v2_local_batch_images_post.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Body_local_async_gen_images_api_v2_local_batch_images_post = { - clothing_images: Array; - /** - * 标签,支持多个,多个之间使用逗号分割 - */ - tag: string; - /** - * 风格标签 - */ - style: string; - /** - * 场景标签,支持多个标签,标签之间使用逗号分割 - */ - scenes: string; - /** - * 操作模式,支持 both, edit_only, bg_only - */ - mode?: string; -}; - diff --git a/src/api/models/Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post.ts b/src/api/models/Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post.ts new file mode 100644 index 0000000..82d9809 --- /dev/null +++ b/src/api/models/Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post = { + clothing_images: Array; + /** + * 场景标签集合JSON字符串 + */ + scenes_list: string; +}; + diff --git a/src/api/models/Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post.ts b/src/api/models/Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post.ts new file mode 100644 index 0000000..a95b286 --- /dev/null +++ b/src/api/models/Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post.ts @@ -0,0 +1,20 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post = { + clothing_images: Array; + /** + * 标签列表JSON字符串,格式:["男_上衣_长款_牛仔_红", "xxxx"] + */ + tag_list: string; + /** + * 场景标签JSON字符串 + */ + scenes_list: string; + /** + * 操作模式,支持 both, edit_only, bg_only + */ + mode?: string; +}; + diff --git a/src/api/models/ImageEditItem.ts b/src/api/models/ImageEditItem.ts deleted file mode 100644 index 74d25e8..0000000 --- a/src/api/models/ImageEditItem.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ImageEditItem = { - prompt: string; - edit_image: Blob; - aspect_ratio?: string; - task_id: string; -}; - diff --git a/src/api/models/VideoDataResponse.ts b/src/api/models/VideoDataResponse.ts index 9e61fca..e68b35a 100644 --- a/src/api/models/VideoDataResponse.ts +++ b/src/api/models/VideoDataResponse.ts @@ -4,13 +4,13 @@ /* eslint-disable */ export type VideoDataResponse = { id: number; - task_id?: string; - img_id?: string; - img_url?: string; - img_status?: string; - video_id?: string; - video_url?: string; - video_status?: string; - create_time?: string; + task_id?: (string | null); + img_id?: (string | null); + img_url?: (string | null); + img_status?: (string | null); + video_id?: (string | null); + video_url?: (string | null); + video_status?: (string | null); + create_time?: (string | null); }; diff --git a/src/api/models/index.ts b/src/api/models/index.ts index 3bd3e28..15fae34 100644 --- a/src/api/models/index.ts +++ b/src/api/models/index.ts @@ -1,17 +1,12 @@ -export * from './BatchImageEditData'; export * from './BatchVideoTaskRequest'; -export * from './Body_async_custom_edit_image_api_async_custom_image_post'; export * from './Body_create_model_api_models_create_post'; -export * from './Body_handler_submit_task_api_comfy_async_submit_task_post'; -export * from './Body_local_async_batch_bg_opt_api_local_batch_change_bg_post'; -export * from './Body_local_async_change_bg_api_local_change_bg_post'; export * from './Body_local_async_change_bg_api_v2_local_batch_change_bg_post'; export * from './Body_local_async_gen_images_api_v2_local_batch_edit_images_post'; -export * from './Body_local_async_gen_images_api_v2_local_batch_images_post'; +export * from './Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post'; +export * from './Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post'; export * from './Body_update_model_api_models__model_id__put'; export * from './Body_upload_image_api_upload_post'; export * from './HTTPValidationError'; -export * from './ImageEditItem'; export * from './PaginationResponse'; export * from './TaskQueryRequest'; export * from './UploadResponse'; diff --git a/src/api/schemas/$BatchImageEditData.ts b/src/api/schemas/$BatchImageEditData.ts deleted file mode 100644 index 095b4cf..0000000 --- a/src/api/schemas/$BatchImageEditData.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $BatchImageEditData = { - properties: { - tasks: { - type: 'array', - contains: { - type: 'ImageEditItem', - }, - isRequired: true, - }, - }, -} as const; diff --git a/src/api/schemas/$Body_async_custom_edit_image_api_async_custom_image_post.ts b/src/api/schemas/$Body_async_custom_edit_image_api_async_custom_image_post.ts deleted file mode 100644 index 9dc802e..0000000 --- a/src/api/schemas/$Body_async_custom_edit_image_api_async_custom_image_post.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Body_async_custom_edit_image_api_async_custom_image_post = { - properties: { - img_path: { - type: 'binary', - isRequired: true, - format: 'binary', - }, - }, -} as const; diff --git a/src/api/schemas/$Body_handler_submit_task_api_comfy_async_submit_task_post.ts b/src/api/schemas/$Body_handler_submit_task_api_comfy_async_submit_task_post.ts deleted file mode 100644 index f397a72..0000000 --- a/src/api/schemas/$Body_handler_submit_task_api_comfy_async_submit_task_post.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Body_handler_submit_task_api_comfy_async_submit_task_post = { - properties: { - prompt: { - type: 'string', - isRequired: true, - }, - edit_image: { - type: 'binary', - isRequired: true, - format: 'binary', - }, - aspect_ratio: { - type: 'string', - }, - }, -} as const; diff --git a/src/api/schemas/$Body_local_async_change_bg_api_local_change_bg_post.ts b/src/api/schemas/$Body_local_async_change_bg_api_local_change_bg_post.ts deleted file mode 100644 index fd1d2f7..0000000 --- a/src/api/schemas/$Body_local_async_change_bg_api_local_change_bg_post.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $Body_local_async_change_bg_api_local_change_bg_post = { - properties: { - clothing_image: { - type: 'binary', - isRequired: true, - format: 'binary', - }, - scenario_categories: { - type: 'array', - contains: { - type: 'string', - }, - }, - }, -} as const; diff --git a/src/api/schemas/$Body_local_async_batch_bg_opt_api_local_batch_change_bg_post.ts b/src/api/schemas/$Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post.ts similarity index 60% rename from src/api/schemas/$Body_local_async_batch_bg_opt_api_local_batch_change_bg_post.ts rename to src/api/schemas/$Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post.ts index f28bc69..ee1ae42 100644 --- a/src/api/schemas/$Body_local_async_batch_bg_opt_api_local_batch_change_bg_post.ts +++ b/src/api/schemas/$Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $Body_local_async_batch_bg_opt_api_local_batch_change_bg_post = { +export const $Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post = { properties: { clothing_images: { type: 'array', @@ -12,11 +12,10 @@ export const $Body_local_async_batch_bg_opt_api_local_batch_change_bg_post = { }, isRequired: true, }, - scenario_categories: { - type: 'array', - contains: { - type: 'string', - }, + scenes_list: { + type: 'string', + description: `场景标签集合JSON字符串`, + isRequired: true, }, }, } as const; diff --git a/src/api/schemas/$Body_local_async_gen_images_api_v2_local_batch_images_post.ts b/src/api/schemas/$Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post.ts similarity index 58% rename from src/api/schemas/$Body_local_async_gen_images_api_v2_local_batch_images_post.ts rename to src/api/schemas/$Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post.ts index 9c903de..1e31f0a 100644 --- a/src/api/schemas/$Body_local_async_gen_images_api_v2_local_batch_images_post.ts +++ b/src/api/schemas/$Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export const $Body_local_async_gen_images_api_v2_local_batch_images_post = { +export const $Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post = { properties: { clothing_images: { type: 'array', @@ -12,19 +12,14 @@ export const $Body_local_async_gen_images_api_v2_local_batch_images_post = { }, isRequired: true, }, - tag: { + tag_list: { type: 'string', - description: `标签,支持多个,多个之间使用逗号分割`, + description: `标签列表JSON字符串,格式:["男_上衣_长款_牛仔_红", "xxxx"]`, isRequired: true, }, - style: { + scenes_list: { type: 'string', - description: `风格标签`, - isRequired: true, - }, - scenes: { - type: 'string', - description: `场景标签,支持多个标签,标签之间使用逗号分割`, + description: `场景标签JSON字符串`, isRequired: true, }, mode: { diff --git a/src/api/schemas/$ImageEditItem.ts b/src/api/schemas/$ImageEditItem.ts deleted file mode 100644 index a4d9d5e..0000000 --- a/src/api/schemas/$ImageEditItem.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export const $ImageEditItem = { - properties: { - prompt: { - type: 'string', - isRequired: true, - }, - edit_image: { - type: 'binary', - isRequired: true, - format: 'binary', - }, - aspect_ratio: { - type: 'string', - }, - task_id: { - type: 'string', - isRequired: true, - }, - }, -} as const; diff --git a/src/api/schemas/$VideoDataResponse.ts b/src/api/schemas/$VideoDataResponse.ts index 56afc04..b95725d 100644 --- a/src/api/schemas/$VideoDataResponse.ts +++ b/src/api/schemas/$VideoDataResponse.ts @@ -9,29 +9,69 @@ export const $VideoDataResponse = { isRequired: true, }, task_id: { - type: 'string', + type: 'any-of', + contains: [{ + type: 'string', + }, { + type: 'null', + }], }, img_id: { - type: 'string', + type: 'any-of', + contains: [{ + type: 'string', + }, { + type: 'null', + }], }, img_url: { - type: 'string', + type: 'any-of', + contains: [{ + type: 'string', + }, { + type: 'null', + }], }, img_status: { - type: 'string', + type: 'any-of', + contains: [{ + type: 'string', + }, { + type: 'null', + }], }, video_id: { - type: 'string', + type: 'any-of', + contains: [{ + type: 'string', + }, { + type: 'null', + }], }, video_url: { - type: 'string', + type: 'any-of', + contains: [{ + type: 'string', + }, { + type: 'null', + }], }, video_status: { - type: 'string', + type: 'any-of', + contains: [{ + type: 'string', + }, { + type: 'null', + }], }, create_time: { - type: 'string', - format: 'date-time', + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', + }, { + type: 'null', + }], }, }, } as const; diff --git a/src/api/services/ComfyService.ts b/src/api/services/ComfyService.ts deleted file mode 100644 index cfb4755..0000000 --- a/src/api/services/ComfyService.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { BatchImageEditData } from '../models/BatchImageEditData'; -import type { Body_handler_submit_task_api_comfy_async_submit_task_post } from '../models/Body_handler_submit_task_api_comfy_async_submit_task_post'; -import type { CancelablePromise } from '../core/CancelablePromise'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -export class ComfyService { - /** - * 提交单个编辑图片任务 - * ComfyUI任务提交接口 - * @returns any Successful Response - * @throws ApiError - */ - public static handlerSubmitTaskApiComfyAsyncSubmitTaskPost({ - formData, - }: { - formData: Body_handler_submit_task_api_comfy_async_submit_task_post, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/comfy/async/submit/task', - formData: formData, - mediaType: 'multipart/form-data', - errors: { - 422: `Validation Error`, - }, - }); - } - /** - * Handler Query Task - * 查询单个任务状态接口 - * :param task_id: 我们的任务ID - * :param db: 数据库会话 - * :return: 任务状态信息 - * @returns any Successful Response - * @throws ApiError - */ - public static handlerQueryTaskApiComfyAsyncQueryTaskTaskIdGet({ - taskId, - }: { - taskId: string, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/comfy/async/query/task/{task_id}', - path: { - 'task_id': taskId, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - /** - * Handler Query All Tasks - * 查询所有任务列表接口 - * :param skip: 跳过数量 - * :param limit: 限制数量 - * :param db: 数据库会话 - * :return: 任务列表 - * @returns any Successful Response - * @throws ApiError - */ - public static handlerQueryAllTasksApiComfyAsyncQueryTaskGet({ - skip, - limit = 10, - }: { - skip?: number, - limit?: number, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/comfy/async/query/task', - query: { - 'skip': skip, - 'limit': limit, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - /** - * Handler Query Pending Tasks - * 查询所有待处理的任务 - * :param db: 数据库会话 - * :return: 待处理任务列表 - * @returns any Successful Response - * @throws ApiError - */ - public static handlerQueryPendingTasksApiComfyAsyncQueryTasksPendingGet(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/api/comfy/async/query/tasks/pending', - }); - } - /** - * 批量提交编辑图片任务,最大同时支持两个任务 - * 批量提交编辑图片任务,接收表单数据,tasks_json是任务列表JSON,files是文件列表 - * @returns any Successful Response - * @throws ApiError - */ - public static bacthSyncSubmitTaskApiComfyasyncBatchSubmitTaskPost({ - requestBody, - }: { - requestBody: BatchImageEditData, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/comfyasync/batch/submit/task', - body: requestBody, - mediaType: 'application/json', - errors: { - 422: `Validation Error`, - }, - }); - } -} diff --git a/src/api/services/DefaultService.ts b/src/api/services/DefaultService.ts index 64886e3..dad4752 100644 --- a/src/api/services/DefaultService.ts +++ b/src/api/services/DefaultService.ts @@ -2,12 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Body_async_custom_edit_image_api_async_custom_image_post } from '../models/Body_async_custom_edit_image_api_async_custom_image_post'; -import type { Body_local_async_batch_bg_opt_api_local_batch_change_bg_post } from '../models/Body_local_async_batch_bg_opt_api_local_batch_change_bg_post'; -import type { Body_local_async_change_bg_api_local_change_bg_post } from '../models/Body_local_async_change_bg_api_local_change_bg_post'; import type { Body_local_async_change_bg_api_v2_local_batch_change_bg_post } from '../models/Body_local_async_change_bg_api_v2_local_batch_change_bg_post'; import type { Body_local_async_gen_images_api_v2_local_batch_edit_images_post } from '../models/Body_local_async_gen_images_api_v2_local_batch_edit_images_post'; -import type { Body_local_async_gen_images_api_v2_local_batch_images_post } from '../models/Body_local_async_gen_images_api_v2_local_batch_images_post'; +import type { Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post } from '../models/Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post'; +import type { Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post } from '../models/Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post'; import type { Body_upload_image_api_upload_post } from '../models/Body_upload_image_api_upload_post'; import type { PaginationResponse } from '../models/PaginationResponse'; import type { TaskQueryRequest } from '../models/TaskQueryRequest'; @@ -37,104 +35,6 @@ export class DefaultService { }, }); } - /** - * @deprecated - * 本地换背景 - * @returns any Successful Response - * @throws ApiError - */ - public static localAsyncChangeBgApiLocalChangeBgPost({ - formData, - }: { - formData: Body_local_async_change_bg_api_local_change_bg_post, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/local/change/bg', - formData: formData, - mediaType: 'multipart/form-data', - errors: { - 422: `Validation Error`, - }, - }); - } - /** - * @deprecated - * 本地批量换背景图片 - * @returns any Successful Response - * @throws ApiError - */ - public static localAsyncBatchBgOptApiLocalBatchChangeBgPost({ - formData, - }: { - formData: Body_local_async_batch_bg_opt_api_local_batch_change_bg_post, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/local/batch/change/bg', - formData: formData, - mediaType: 'multipart/form-data', - errors: { - 422: `Validation Error`, - }, - }); - } - /** - * @deprecated - * 异步自定义图片生成 - 立即返回task_id - * 异步版本:立即返回task_id,避免阻塞worker - * 客户端需要用task_id轮询 /api/check_task 查询结果 - * @returns any Successful Response - * @throws ApiError - */ - public static asyncCustomEditImageApiAsyncCustomImagePost({ - formData, - }: { - formData: Body_async_custom_edit_image_api_async_custom_image_post, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/async/custom/image', - formData: formData, - mediaType: 'multipart/form-data', - errors: { - 422: `Validation Error`, - }, - }); - } - /** - * @deprecated - * 本地新版异步图片生成接口 - * 本地新版异步图片生成接口 - * - * Args: - * clothing_images: 服装图片文件列表 - * tag: 模特标签(用于筛选模特) - * style: 风格标签(如:少女、马来) - * scenes: 场景标签(如:室内,室外) - * mode: 操作模式(both/edit_only/bg_only) - * db: 数据库会话 - * - * Returns: - * dict: 异步任务提交结果 - * @returns any Successful Response - * @throws ApiError - */ - public static localAsyncGenImagesApiV2LocalBatchImagesPost({ - formData, - }: { - formData: Body_local_async_gen_images_api_v2_local_batch_images_post, - }): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/api/v2/local/batch/images', - formData: formData, - mediaType: 'multipart/form-data', - errors: { - 422: `Validation Error`, - }, - }); - } /** * 本地新版异步图片生成接口 * 本地新版异步图片生成接口 @@ -271,4 +171,76 @@ export class DefaultService { }, }); } + /** + * 本地V2云端智能负载均衡异步图片生成接口 + * 本地V2云端智能负载均衡异步图片生成接口 + * + * 🚀 新功能: + * - 智能负载均衡:自动选择最优ComfyUI节点 + * - 实时节点健康检测:避免任务分配到故障节点 + * - 性能优化:响应时间优化分配算法 + * - 内部统计监控:记录执行统计信息到日志 + * + * Args: + * clothing_images: 服装图片文件列表 + * tag_list: 标签列表JSON字符串,格式:["男_上衣_长款_牛仔_红", "xxxx"] 注意tag_list 与 clothing_images 长度一致 + * scenes_list: 场景标签JSON字符串,格式:[{"title": "客厅1","prompt": "室内场景..."}] + * mode: 操作模式(both/edit_only/bg_only) + * db: 数据库会话 + * + * Returns: + * dict: 异步任务提交结果(格式与V2版本完全一致) + * @returns any Successful Response + * @throws ApiError + */ + public static localCloudAsyncGenImagesApiV2CloudBatchEditImagesPost({ + formData, + }: { + formData: Body_local_cloud_async_gen_images_api_v2_cloud_batch_edit_images_post, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v2/cloud/batch/edit/images', + formData: formData, + mediaType: 'multipart/form-data', + errors: { + 422: `Validation Error`, + }, + }); + } + /** + * 本地V2云端智能负载均衡异步换背景接口 + * 本地V2云端智能负载均衡异步换背景接口 + * + * 🚀 新功能: + * - 智能负载均衡:自动选择最优ComfyUI节点 + * - 实时节点健康检测:避免任务分配到故障节点 + * - 性能优化:响应时间优化分配算法 + * - 内部统计监控:记录执行统计信息到日志 + * + * Args: + * clothing_images: 服装图片文件列表 + * scenes_list: 场景标签集合JSON字符串 + * db: 数据库会话 + * + * Returns: + * dict: 异步任务提交结果(格式与V2版本完全一致) + * @returns any Successful Response + * @throws ApiError + */ + public static localCloudAsyncChangeBgApiV2CloudBatchChangeBgPost({ + formData, + }: { + formData: Body_local_cloud_async_change_bg_api_v2_cloud_batch_change_bg_post, + }): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/v2/cloud/batch/change/bg', + formData: formData, + mediaType: 'multipart/form-data', + errors: { + 422: `Validation Error`, + }, + }); + } } diff --git a/src/api/services/Service.ts b/src/api/services/Service.ts index 21f8dd9..60fef26 100644 --- a/src/api/services/Service.ts +++ b/src/api/services/Service.ts @@ -87,6 +87,30 @@ export class Service { }, }); } + /** + * 获取Modal配置信息 + * 获取当前Modal服务配置信息 + * @returns any Successful Response + * @throws ApiError + */ + public static getModalConfigApiJmModalConfigGet(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/jm/modal/config', + }); + } + /** + * 刷新Modal配置 + * 刷新Modal配置,重新自动发现端点URL + * @returns any Successful Response + * @throws ApiError + */ + public static refreshModalConfigApiJmModalConfigRefreshPost(): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/jm/modal/config/refresh', + }); + } /** * 创建模型 * 创建模型 @@ -129,7 +153,7 @@ export class Service { }); } /** - * 获取模型列表 + * 获取模特列表 * 获取模型列表 * * Args: @@ -312,7 +336,7 @@ export class Service { }); } /** - * 获取风格标签结构(外层风格 + 内层场景) + * 获取换背景标签 * @returns any Successful Response * @throws ApiError */ @@ -334,7 +358,7 @@ export class Service { }); } /** - * 获取JM模型的提示词 + * 获取jm生成视频的提示词 * @returns any Successful Response * @throws ApiError */ diff --git a/src/api/services/WebhookService.ts b/src/api/services/WebhookService.ts index b56ba90..f97eec2 100644 --- a/src/api/services/WebhookService.ts +++ b/src/api/services/WebhookService.ts @@ -7,6 +7,7 @@ import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; export class WebhookService { /** + * @deprecated * 异步数据处理 * @returns any Successful Response * @throws ApiError diff --git a/src/api/services/index.ts b/src/api/services/index.ts index 36508ae..51cb6d9 100644 --- a/src/api/services/index.ts +++ b/src/api/services/index.ts @@ -1,3 +1,2 @@ -export * from './ComfyService'; export * from './DefaultService'; export * from './WebhookService'; \ No newline at end of file