🦋
SYNAPSE API
  • 📚SYNAPSE
  • Services
    • 💬Language Models
    • 🎨Stable Diffusion
    • 🖼️Stable Diffusion XL
    • 🛝Playground
    • 👨‍🎨DALL-E-3
    • 🎤Whisper
    • 🗣️Text To Speech
  • Info
    • ⛓️Limits
    • ❓Support
    • 🔑API Key
    • 👑Premium
Powered by GitBook
On this page
  1. Services

Playground

Create Image

POST /playground

Prompt the playground model for an image

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description
Default

version

string

Model version

2.5

prompt

string

Image prompt

none

negative_prompt

string

Negative prompt

custom

guidance_scale

number

Prompt following

3

Response

{
  "data": "d2VsbF9oZWxsb190aGVyZV90Lm1lL3N5bmFwc2VfbGFicw....."
}
{
  "error": "Invalid request"
}
{
  "error": "Error during generation (Playground)"
}

Example

example.js
const res = await fetch('https://synapselabs.onrender.com/playground', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <your_api_key>'
  },
  body: JSON.stringify({
    prompt: 'A cat',
  }),
});

const data = await res.json();
const buf = Buffer.from(data.data, 'base64');
fs.writeFileSync('test.png', buf);
PreviousStable Diffusion XLNextDALL-E-3

Last updated 1 year ago

🛝