🦋
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
  • List Models
  • List Samplers
  • List Loras
  • List Embedding
  • Create Image
  1. Services

Stable Diffusion

Stable Diffusion Models

List Models

GET /sd/list

List all currently available Stable Diffusion models

Headers

Name
Value

Content-Type

application/json

Response

["Counterfeit_v3", "Anything_v5", ...]
{
  "error": "Invalid request"
}

List Samplers

GET /sd/sampler

List available Samplers

Headers

Name
Value

Content-Type

application/json

Response

["Euler", "Euler a", "LMS", ...]
{
  "error": "Invalid request"
}

List Loras

GET /sd/loras

List available Loras You can use loras in your prompt with <lora:Name:weight>

Headers

Name
Value

Content-Type

application/json

Response

[
  "0mib3_v10",
  "3DMM_V12",
  "age_slider_v20",
  "arcane_offset",
  "AstralMecha",
  ...
]
{
  "error": "Invalid request"
}

List Embedding

GET /sd/embeddings

List available Embeddings

Headers

Name
Value

Content-Type

application/json

Response

[
  "FastNegativeV2",
  "easynegative"
]

Create Image

POST /sd/:model

Send image prompt to Stable Diffusion

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description
Default

prompt

string

Image Prompt

none

negative_prompt

string

Negative prompt

custom

steps

number

Diffusion steps

20

cfg_scale

number

Prompt following

7

sampler

string

Diffusion sampler

DPM++ 2M Karras

Response

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

Example

example.js
const res = await fetch('https://synapselabs.onrender.com/sd/Counterfeit_v3', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer <your_api_key>'
  },
  body: JSON.stringify({
    prompt: 'A cat',
    steps: 20,
    cfg_scale: 7,
    sampler: 'DPM++ 2M Karras',
  }),
});

const data = await res.json();
const buf = Buffer.from(data.data, 'base64');
fs.writeFileSync('test.png', buf);
PreviousLanguage ModelsNextStable Diffusion XL

Last updated 1 year ago

🎨