diff --git a/src/utils/ai/generateVideo.ts b/src/utils/ai/generateVideo.ts index d82e6b1..6ace39d 100644 --- a/src/utils/ai/generateVideo.ts +++ b/src/utils/ai/generateVideo.ts @@ -1,7 +1,6 @@ import axios from "axios"; import u from "@/utils"; import FormData from "form-data"; -import axiosRetry from "axios-retry"; import sharp from "sharp"; type VideoAspectRatio = "16:9" | "9:16" | "1:1" | "4:3" | "3:4" | "21:9" | "adaptive"; diff --git a/src/utils/ai/image/owned/apimart.ts b/src/utils/ai/image/owned/apimart.ts index 914aaeb..eab1174 100644 --- a/src/utils/ai/image/owned/apimart.ts +++ b/src/utils/ai/image/owned/apimart.ts @@ -1,8 +1,6 @@ import axios from "axios"; -import axiosRetry from "axios-retry"; import { pollTask } from "@/utils/ai/utils"; -axiosRetry(axios, { retries: 3, retryDelay: () => 200 }); export default async (input: ImageConfig, config: AIConfig): Promise => { if (!config.apiKey) throw new Error("缺少API Key"); diff --git a/src/utils/ai/image/owned/runninghub.ts b/src/utils/ai/image/owned/runninghub.ts index 032a15c..79a00d5 100644 --- a/src/utils/ai/image/owned/runninghub.ts +++ b/src/utils/ai/image/owned/runninghub.ts @@ -1,10 +1,8 @@ import axios from "axios"; import FormData from "form-data"; -import axiosRetry from "axios-retry"; import sharp from "sharp"; import { pollTask } from "@/utils/ai/utils"; -axiosRetry(axios, { retries: 3, retryDelay: () => 200 }); // 上传 base64 图片到 runninghub const uploadBase64ToRunninghub = async (base64Image: string, apiKey: string, baseURL: string): Promise => { try { @@ -13,8 +11,8 @@ const uploadBase64ToRunninghub = async (base64Image: string, apiKey: string, bas const base64Data = base64Image.replace(/^data:image\/\w+;base64,/, ""); let buffer = Buffer.from(base64Data, "base64"); - // 压缩图片到 5MB 以下 - const MAX_SIZE = 5 * 1024 * 1024; // 5MB + // 压缩图片到 7MB 以下 + const MAX_SIZE = 7 * 1024 * 1024; // 7MB if (buffer.length > MAX_SIZE) { let quality = 90;