Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -19,6 +19,7 @@ const Waifu2X = require('@ibaraki-douji/waifu2x')
|
|
| 19 |
const { acytoo, chatgpt_4 } = require("./lib/chatgpt.js")
|
| 20 |
const { sss_instagram, gramvio } = require("./lib/instagram.js")
|
| 21 |
const { allToJpg } = require("./lib/convertFormat.js")
|
|
|
|
| 22 |
const apikey = "@SadTeam77"
|
| 23 |
|
| 24 |
const app = express()
|
|
@@ -629,6 +630,20 @@ async function processImageUpscaler(images, denoise, format, type) {
|
|
| 629 |
});
|
| 630 |
}
|
| 631 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 632 |
async function processImageAnime(inputBuffer) {
|
| 633 |
try {
|
| 634 |
// const base64String = Buffer.from(inputBuffer, 'binary').toString('base64');
|
|
@@ -665,6 +680,8 @@ async function processImageAnime(inputBuffer) {
|
|
| 665 |
}
|
| 666 |
}
|
| 667 |
|
|
|
|
|
|
|
| 668 |
async function check_nsfw(buffer) {
|
| 669 |
let _model = await load_model()
|
| 670 |
const convert = async (img) => {
|
|
|
|
| 19 |
const { acytoo, chatgpt_4 } = require("./lib/chatgpt.js")
|
| 20 |
const { sss_instagram, gramvio } = require("./lib/instagram.js")
|
| 21 |
const { allToJpg } = require("./lib/convertFormat.js")
|
| 22 |
+
const { Blob } = require("formdata-node")
|
| 23 |
const apikey = "@SadTeam77"
|
| 24 |
|
| 25 |
const app = express()
|
|
|
|
| 630 |
});
|
| 631 |
}
|
| 632 |
|
| 633 |
+
async function processImage2Img(imgBuffer, prompt) {
|
| 634 |
+
const type = fileType(imgBuffer);
|
| 635 |
+
const convertingBlob = new Blob([imgBuffer], { type: type.mime });
|
| 636 |
+
|
| 637 |
+
const app = await Client.connect("Manjushri/SDXL-Turbo-Img2Img-CPU");
|
| 638 |
+
const result = await app.predict("/predict", [
|
| 639 |
+
imageBlob, // blob in 'Raw Image.' Image component
|
| 640 |
+
"Hello!!", // string in 'Prompt Input Text. 77 Token (Keyword or Symbol) Maximum' Textbox component
|
| 641 |
+
1, // number (numeric value between 1 and 5) in 'Number of Iterations' Slider component
|
| 642 |
+
0, // number (numeric value between 0 and 987654321987654321) in 'Seed' Slider component
|
| 643 |
+
0.1, // number (numeric value between 0.1 and 1) in 'Strength' Slider component
|
| 644 |
+
]);
|
| 645 |
+
}
|
| 646 |
+
|
| 647 |
async function processImageAnime(inputBuffer) {
|
| 648 |
try {
|
| 649 |
// const base64String = Buffer.from(inputBuffer, 'binary').toString('base64');
|
|
|
|
| 680 |
}
|
| 681 |
}
|
| 682 |
|
| 683 |
+
|
| 684 |
+
|
| 685 |
async function check_nsfw(buffer) {
|
| 686 |
let _model = await load_model()
|
| 687 |
const convert = async (img) => {
|