v1.0 Specifications

CompilePrompt Cheatsheet

A comprehensive developer reference guide to the sovereign Bracket DSL syntax, parser logic, variable operations, and compilation flow.

01 / Key Features & Specs

Bidirectional Translation

CompilePrompt compiles human-readable tags into structured JSON models ready for Vertex AI / NanoBanana rendering, and decompiles JSON back into clean tags.

Deterministic Ordering

Pure bracket inputs are organized deterministically: subject first, followed by styles, lighting parameters, and mood attributes, before custom keys are appended.

Multi-Modal References

Connect external image, face, or style assets dynamically using reference syntax tags, carrying customizable weightings and target parameter types.

Tokenizer Control

Supports quote boundary preservation (`"..."`) and character escaping to preserve punctuation, colons, or brackets inside tag values.

02 / Bracket DSL Reference

All prompt compiler declarations are defined inside brackets [key: value]. Extra text written outside brackets is compiled directly as raw prompt text.

A. Core Metadata Attributes

[subject: ...]Specifies the main image subject content.
[style: ...]Adds rendering style modifiers (e.g. cinematic, 3D render).
[lighting: ...]Defines light source details (e.g. golden hour, soft backlight).
[mood: ...]Appends atmospheric emotional indicators.

B. Reference Asset Syntax

Declares reference objects via [ref: sourceId, weight: N, type: T].

[ref: asset_9921, weight: 0.85, type: face]

• asset_9921 is compiled to sourceId
• weight specifies weighting (defaults to 1.0)
• type specifies adapter mapping (style, face, image)

C. Hardware Settings

Adjusts model and format settings using dedicated tags.

[aspect_ratio: 16:9]Sets layout shape
[quality: premium]Selects output quality level

03 / Variable & Operation Syntax

CompilePrompt supports dynamic prompt templating using double-curly brace placeholders. When blueprints or prompts are compiled, the workspace processes these parameters to display interactive inputs.

Simple Variable

{{variable_name}}

Specifies a variable without any initial value. The UI extracts this as an empty text input. E.g., {{subject}}.

Variable with Default Value

{{variable_name:default_value}}

Defines a fallback value separated by a colon. The UI renders this value inside the input field as a placeholder. E.g., {{gender:cyborg warrior}}.

Operations & Lifecycle

1

Dynamic Variables Extraction

The template parser searches for placeholders using the regex /{{\s*(.*?)\s*}}/g. It splits the inside contents on the first colon : to isolate the key from the default value.

2

Variable Baking

"Baking" writes the user's customized values back into the blueprint template, saving them as the new defaults. The system updates the pattern dynamically:

// Template containing default value:

[subject: A portrait of a {{gender:man}} in neon rain]

// User changes "gender" variable input to "woman", then clicks "Bake":

[subject: A portrait of a {{gender:woman}} in neon rain]

3

Rendering Highlight Mode (DEF vs VAL Markers)

When displaying the compiled output preview, the UI isolates and color-codes parameters based on whether they are customized or relying on defaults:

Default Mode (DEF)__DEF__value__DEF__If a variable value is matching its default, it wraps it in __DEF__ rendering as muted italicized text.
Customized Mode (VAL)__VAL__value__VAL__If a variable value has been customized, it wraps it in __VAL__ rendering as a accent highlighted tag.

04 / Compile Flow Comparison

Bracket DSL Input
[subject: A portrait of a {{gender:cyborg warrior}}] [style: 3D render, octane render] [lighting: neon studio ring light] [mood: intense, focused] [ref: asset_4480, weight: 0.85, type: style] [aspect_ratio: 16:9] [quality: premium]
Target Master JSON Schema
{
  "promptText": "A portrait of a cyborg warrior, 3D render, octane render, neon studio ring light, intense, focused",
  "meta": {
    "subject": "A portrait of a cyborg warrior",
    "style": "3D render, octane render",
    "lighting": "neon studio ring light",
    "mood": "intense, focused"
  },
  "references": [
    {
      "sourceId": "asset_4480",
      "weight": 0.85,
      "type": "style"
    }
  ],
  "settings": {
    "aspectRatio": "16:9",
    "quality": "premium"
  }
}

05 / Developer Handbook

1. Writing Tag Prompts

Create a template combining brackets and variables. Place standard visual features under metadata selectors, settings under Settings keys, and use references for IP-Adapters.

2. API Integration

For production applications, authenticate using headers and fetch the /api/v1/compile endpoint, supplying raw template variables in the request payload.

3. Validating JSON

The Master JSON output contains fully verified parameters. Ensure values like aspect ratios match target platform resolutions before dispatching commands.