Skip to content

Style Presets API ​

Endpoints for managing reusable style presets.

Overview ​

Style presets save reusable prompt templates and style configurations for consistent branding across image generations. Apply presets to automatically include prompt prefixes, negative prompts, and system instructions.

Style Presets Flow

Define once, apply to unlimited generations for consistent style

List Style Presets ​

Retrieve all saved style presets.

http
GET /api/style-presets

Request ​

bash
curl -X GET "https://gobananasai.com/api/style-presets" \
  -H "X-API-Key: sk_live_xxx"

Response ​

json
{
  "data": [
    {
      "id": 1,
      "name": "Watercolor Art",
      "prompt": "watercolor painting style, soft edges, flowing colors,",
      "negative_prompt": "sharp edges, digital art, photorealistic",
      "system_instruction": "Create images in a traditional watercolor painting style with soft, flowing colors and gentle blending",
      "aspect_ratio": "square",
      "created_at": "2024-01-01T00:00:00.000Z",
      "updated_at": "2024-01-10T00:00:00.000Z"
    }
  ],
  "pagination": {
    "limit": 1,
    "offset": 0,
    "total": 3
  }
}

Get Style Preset ​

Retrieve details for a specific preset.

http
GET /api/style-presets/:id

Request ​

bash
curl -X GET "https://gobananasai.com/api/style-presets/1" \
  -H "X-API-Key: sk_live_xxx"

Response ​

json
{
  "data": {
    "id": 1,
    "name": "Watercolor Art",
    "prompt": "watercolor painting style, soft edges, flowing colors,",
    "negative_prompt": "sharp edges, digital art, photorealistic",
    "system_instruction": "Create images in a traditional watercolor painting style with soft, flowing colors and gentle blending",
    "aspect_ratio": "square",
    "created_at": "2024-01-01T00:00:00.000Z",
    "updated_at": "2024-01-10T00:00:00.000Z"
  }
}

Create Style Preset ​

Save a new reusable style preset.

http
POST /api/style-presets

Request Body ​

FieldTypeRequiredDescription
namestringYesUnique name (1-128 chars)
promptstringNoPrefix prepended to prompts (max: 2048)
negative_promptstringNoDefault negative prompt (max: 1024)
system_instructionstringNoStyle guidance (max: 512)
aspect_ratiostringNoDefault aspect ratio

Request ​

bash
curl -X POST "https://gobananasai.com/api/style-presets" \
  -H "X-API-Key: sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cinematic Dark",
    "prompt": "cinematic composition, dramatic lighting, moody atmosphere,",
    "negative_prompt": "bright, cheerful, cartoon, amateur",
    "system_instruction": "Create images with cinematic quality, dramatic lighting, and film-like color grading",
    "aspect_ratio": "16:9"
  }'

Response ​

json
{
  "data": {
    "id": 4,
    "name": "Cinematic Dark",
    "prompt": "cinematic composition, dramatic lighting, moody atmosphere,",
    "negative_prompt": "bright, cheerful, cartoon, amateur",
    "system_instruction": "Create images with cinematic quality, dramatic lighting, and film-like color grading",
    "aspect_ratio": "16:9",
    "created_at": "2024-01-15T11:00:00.000Z",
    "updated_at": "2024-01-15T11:00:00.000Z"
  }
}

Update Style Preset ​

Modify an existing preset.

http
PATCH /api/style-presets/:id

Request Body ​

All fields are optional. Provide null to clear a field.

FieldTypeDescription
new_namestringNew name
promptstring | nullUpdated prefix (null to clear)
negative_promptstring | nullUpdated negative (null to clear)
system_instructionstring | nullUpdated instruction (null to clear)
aspect_ratiostring | nullUpdated aspect ratio (null to clear)

Request ​

bash
curl -X PATCH "https://gobananasai.com/api/style-presets/4" \
  -H "X-API-Key: sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "new_name": "Cinematic Noir",
    "prompt": "film noir style, high contrast, dramatic shadows,",
    "system_instruction": "Create images in classic film noir style with high contrast black and white or desaturated colors"
  }'

Response ​

json
{
  "data": {
    "id": 4,
    "name": "Cinematic Noir",
    "prompt": "film noir style, high contrast, dramatic shadows,",
    "negative_prompt": "bright, cheerful, cartoon, amateur",
    "system_instruction": "Create images in classic film noir style with high contrast black and white or desaturated colors",
    "aspect_ratio": "16:9",
    "created_at": "2024-01-15T11:00:00.000Z",
    "updated_at": "2024-01-15T11:15:00.000Z"
  }
}

Delete Style Preset ​

Remove a style preset.

http
DELETE /api/style-presets/:id

Request ​

bash
curl -X DELETE "https://gobananasai.com/api/style-presets/4" \
  -H "X-API-Key: sk_live_xxx"

Response ​

json
{
  "data": { "deleted": true }
}

Using Presets in Generation ​

Apply a preset when generating images:

By ID ​

bash
curl -X POST "https://gobananasai.com/api/images" \
  -H "X-API-Key: sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a peaceful mountain lake at sunset",
    "style_preset_id": 1
  }'

By Name ​

bash
curl -X POST "https://gobananasai.com/api/images" \
  -H "X-API-Key: sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a peaceful mountain lake at sunset",
    "style_preset_name": "Watercolor Art"
  }'

How Presets Are Applied ​

When a preset is applied:

  1. Prompt Prefix: Preset's prompt is prepended to your prompt

    Final prompt: "watercolor painting style, soft edges, flowing colors, a peaceful mountain lake at sunset"
  2. Negative Prompt: Preset's negative_prompt is used if you don't specify one

  3. System Instruction: Preset's system_instruction guides the model

  4. Aspect Ratio: Preset's aspect_ratio is used if you don't specify one

Override Preset Defaults ​

You can override any preset default:

bash
curl -X POST "https://gobananasai.com/api/images" \
  -H "X-API-Key: sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "a peaceful mountain lake at sunset",
    "style_preset_name": "Watercolor Art",
    "negative_prompt": "people, buildings",
    "aspect_ratio": "landscape"
  }'

Error Responses ​

400 Validation Error ​

json
{
  "error": "Preset name must be between 1 and 128 characters"
}

404 Preset Not Found ​

json
{
  "error": "Style preset not found"
}

409 Duplicate Name ​

json
{
  "error": "Style preset with name \"Watercolor Art\" already exists"
}

Next Steps ​

Released under the MIT License.