JSON Editor
The JSON editor provides direct access to your project configuration. Use it for advanced settings or bulk edits.
Accessing the Editor
Click the JSON button in the bottom-left corner of Setup or Detection pages.
The editor opens as a slide-out panel.
Project Structure
{
"prompt": "Your image generation prompt...",
"config": {
"model": "gemini-2.5-flash-image",
"aspectRatio": "1:1",
"imageSize": "1K",
"remove_bg": false,
"bg_removal_model": "u2net",
"num_images": 1,
"selected_base_image": 1
},
"analysis": {
"traits": ["eyes", "antenna", "background"],
"layer_order": ["background", "eyes", "antenna"],
"detection_prompts": {
"eyes": "the robot's large round eyes",
"antenna": "the antenna on top",
"background": "the entire background"
},
"detection_model": "gemini-2.5-flash"
},
"variations": [
{
"trait": "eyes",
"prompt": "glowing red LED eyes"
},
{
"trait": "eyes",
"prompt": "blue neon eyes"
}
]
}
Configuration Sections
prompt
The main image generation prompt.
{
"prompt": "A cute robot mascot with large eyes..."
}
config
Generation settings:
| Field | Type | Description |
|---|---|---|
| model | string | gemini-2.5-flash-image or gemini-3-pro-image-preview |
| aspectRatio | string | 1:1, 16:9, etc. |
| imageSize | string | 1K, 2K, 4K (Pro only) |
| remove_bg | boolean | Auto-remove background |
| bg_removal_model | string | Background removal model |
| selected_base_image | number | Which base image slot (1-5) |
analysis
Trait detection settings:
| Field | Type | Description |
|---|---|---|
| traits | array | List of trait names |
| layer_order | array | Back-to-front layer order |
| detection_prompts | object | Custom prompts per trait |
| detection_model | string | AI model for detection |
variations
Array of variation prompts:
{
"variations": [
{"trait": "eyes", "prompt": "glowing red LED eyes"},
{"trait": "eyes", "prompt": "blue neon eyes"},
{"trait": "antenna", "prompt": "satellite dish antenna"}
]
}
Editing Tips
Adding Traits
Add to both traits and layer_order:
{
"analysis": {
"traits": ["eyes", "antenna", "hat"],
"layer_order": ["eyes", "antenna", "hat"]
}
}
Bulk Adding Variations
Add multiple variations at once:
{
"variations": [
{"trait": "eyes", "prompt": "red eyes"},
{"trait": "eyes", "prompt": "blue eyes"},
{"trait": "eyes", "prompt": "green eyes"},
{"trait": "eyes", "prompt": "yellow eyes"}
]
}
Custom Detection Prompts
Set specific prompts per trait:
{
"analysis": {
"detection_prompts": {
"eyes": "the character's large expressive eyes including pupils and eyelids",
"background": "everything behind the main character"
}
}
}
Validation
The editor validates your JSON:
- Syntax errors - Shown below the editor
- Save button - Disabled if JSON is invalid
- Auto-format - Proper indentation applied
Saving Changes
- Make your edits
- Check for validation errors
- Click Save
- Changes apply immediately
The UI updates to reflect your changes.
Syncing with UI
Changes in the JSON editor sync to the UI:
- Traits appear in the trait list
- Prompts update in input fields
- Settings update in dropdowns
Changes in the UI sync to JSON:
- Next time you open the editor, you see current state
- Both directions stay in sync
Use Cases
Bulk Trait Setup
Add many traits at once instead of clicking "+ Add Trait" repeatedly.
Copying Between Projects
Export JSON from one project, edit, paste into another.
Backup Configuration
Copy JSON to save your settings externally.
Complex Prompt Editing
Multi-line prompts are easier to edit in JSON format.
Cautions
Direct JSON editing bypasses UI validation. Invalid configurations may cause issues:
- Traits in
layer_ordermust exist intraits - Variation traits must exist in
traits - Invalid model names will default to Flash
Troubleshooting
Save button disabled
Check for JSON syntax errors. Common issues:
- Missing comma
- Missing quote
- Extra comma at end of array
Changes not appearing
Refresh the page if changes don't apply. Close and reopen the editor.
Traits disappeared
Check that traits array isn't empty. The editor may have cleared it accidentally.