DeFactOfficial commited on
Commit
6299b08
·
verified ·
1 Parent(s): ca74723

Update image.js

Browse files
Files changed (1) hide show
  1. image.js +2 -2
image.js CHANGED
@@ -8,7 +8,7 @@ const { HfInference } = require("@huggingface/inference");
8
  require("dotenv").config()
9
 
10
  // Cache directory to store generated images
11
- const CACHE_DIR = `/home/root/code/public/image_out`
12
 
13
 
14
  if (!fs.existsSync(CACHE_DIR)) {
@@ -112,7 +112,7 @@ const generateImage = async(requestPayload, res, responseFormat) => {
112
  // Send either the image directly or a link to the image
113
  if (responseFormat == "url") {
114
  res.setHeader("Content-Type", "application/json")
115
- res.json({"image_url": "https://defactofficial-mmapi.hf.space/image_out/"+ cachePath.split("/").at(-1)})
116
  res.end()
117
  } else {
118
  res.setHeader('Content-Type', 'application/octet-stream');
 
8
  require("dotenv").config()
9
 
10
  // Cache directory to store generated images
11
+ const CACHE_DIR = `${__dirname}/public/image_out`
12
 
13
 
14
  if (!fs.existsSync(CACHE_DIR)) {
 
112
  // Send either the image directly or a link to the image
113
  if (responseFormat == "url") {
114
  res.setHeader("Content-Type", "application/json")
115
+ res.json({"image_url": "https://defactofficial-mmapi-2.hf.space/image_out/"+ cachePath.split("/").at(-1)})
116
  res.end()
117
  } else {
118
  res.setHeader('Content-Type', 'application/octet-stream');