Rooni commited on
Commit
1722338
·
verified ·
1 Parent(s): 86bd386

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +2 -2
server.js CHANGED
@@ -11,7 +11,7 @@ const apiKey = process.env.KEY;
11
 
12
  app.use(bodyParser.json());
13
 
14
- app.post('/generate-image', async (req, res) => {
15
  const { prompt } = req.body;
16
 
17
  if (!prompt) {
@@ -22,7 +22,7 @@ app.post('/generate-image', async (req, res) => {
22
  // Динамический импорт node-fetch
23
  const fetch = (await import('node-fetch')).default;
24
 
25
- const response = await fetch('https://api-inference.huggingface.co/models/your-model-name', {
26
  method: 'POST',
27
  headers: {
28
  'Authorization': `Bearer ${apiKey}`,
 
11
 
12
  app.use(bodyParser.json());
13
 
14
+ app.post('/', async (req, res) => {
15
  const { prompt } = req.body;
16
 
17
  if (!prompt) {
 
22
  // Динамический импорт node-fetch
23
  const fetch = (await import('node-fetch')).default;
24
 
25
+ const response = await fetch('https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-3-medium', {
26
  method: 'POST',
27
  headers: {
28
  'Authorization': `Bearer ${apiKey}`,