Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -11,7 +11,7 @@ import { askOpenGPT4o } from "./lib/chatgpt.js";
|
|
11 |
import { processImageUpscaler } from "./lib/enchance.js";
|
12 |
import { toAnime } from "./lib/toanime.js";
|
13 |
import { convertWebpToPng } from "./lib/converter.js";
|
14 |
-
import {
|
15 |
|
16 |
const app = express();
|
17 |
app.set('json spaces', 4);
|
@@ -132,7 +132,7 @@ app.post('/api/toanime', async (req, res) => {
|
|
132 |
responseType: "arraybuffer"
|
133 |
})
|
134 |
const response = await toAnime(data_img.data);
|
135 |
-
const converting = await
|
136 |
//const type_img = await fileTypeFromBuffer(converting)
|
137 |
//res.setHeader('Content-Type', type_img.mime)
|
138 |
res.json({
|
@@ -141,7 +141,7 @@ app.post('/api/toanime', async (req, res) => {
|
|
141 |
})
|
142 |
} else if (images && typeof images == 'string' && isBase64(images)) {
|
143 |
const response = await await toAnime(Buffer.from(images, "base64"));
|
144 |
-
const converting = await
|
145 |
//const type_img = await fileTypeFromBuffer(converting)
|
146 |
//res.setHeader('Content-Type', type_img.mime)
|
147 |
res.json({
|
|
|
11 |
import { processImageUpscaler } from "./lib/enchance.js";
|
12 |
import { toAnime } from "./lib/toanime.js";
|
13 |
import { convertWebpToPng } from "./lib/converter.js";
|
14 |
+
import { Uploader } from "./lib/uploader.js"
|
15 |
|
16 |
const app = express();
|
17 |
app.set('json spaces', 4);
|
|
|
132 |
responseType: "arraybuffer"
|
133 |
})
|
134 |
const response = await toAnime(data_img.data);
|
135 |
+
const converting = await Uploader(response[0][0].image.url)
|
136 |
//const type_img = await fileTypeFromBuffer(converting)
|
137 |
//res.setHeader('Content-Type', type_img.mime)
|
138 |
res.json({
|
|
|
141 |
})
|
142 |
} else if (images && typeof images == 'string' && isBase64(images)) {
|
143 |
const response = await await toAnime(Buffer.from(images, "base64"));
|
144 |
+
const converting = await Uploader(response[0][0].image.url)
|
145 |
//const type_img = await fileTypeFromBuffer(converting)
|
146 |
//res.setHeader('Content-Type', type_img.mime)
|
147 |
res.json({
|