Update server.js
Browse files
server.js
CHANGED
|
@@ -11,7 +11,7 @@ const apiKey = process.env.KEY;
|
|
| 11 |
|
| 12 |
app.use(bodyParser.json());
|
| 13 |
|
| 14 |
-
app.post('/
|
| 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/
|
| 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}`,
|