#2016 Fix NovelAI endpoint

This commit is contained in:
Cohee
2024-04-05 22:15:50 +03:00
parent 9e4b765db1
commit f002b2d5cc

View File

@@ -6,6 +6,7 @@ const { readAllChunks, extractFileFromZipBuffer, forwardFetchResponse } = requir
const { jsonParser } = require('../express-common');
const API_NOVELAI = 'https://api.novelai.net';
const IMAGE_NOVELAI = 'https://image.novelai.net';
// Ban bracket generation, plus defaults
const badWordsList = [
@@ -238,7 +239,7 @@ router.post('/generate-image', jsonParser, async (request, response) => {
try {
console.log('NAI Diffusion request:', request.body);
const generateUrl = `${API_NOVELAI}/ai/generate-image`;
const generateUrl = `${IMAGE_NOVELAI}/ai/generate-image`;
const generateResult = await fetch(generateUrl, {
method: 'POST',
headers: {
@@ -289,7 +290,7 @@ router.post('/generate-image', jsonParser, async (request, response) => {
try {
console.debug('Upscaling image...');
const upscaleUrl = `${API_NOVELAI}/ai/upscale`;
const upscaleUrl = `${IMAGE_NOVELAI}/ai/upscale`;
const upscaleResult = await fetch(upscaleUrl, {
method: 'POST',
headers: {