Importing and Editing AI-Generated Style JSON
How Flow Batch Studio validates incoming custom style JSON, common syntax errors to avoid, and how to edit imported specifications before saving.
How JSON Validation Protects Your Project
When you paste JSON into the New Custom Visual Style dialog and click Import and Validate, Flow Batch Studio executes a multi-point validation pass before saving anything to your database:
- Syntax Check: Verifies that the text is valid JSON without broken braces, missing commas, or unescaped quotes.
- Markdown Stripping: Automatically removes surrounding Markdown code fences (``
json ...``) so you do not have to clean the text manually. - Schema Normalization: Confirms that all mandatory fields exist (name, medium, positive tokens, negative constraints, image instructions, and video instructions).
- Text Bounds Check: Ensures that no single field exceeds safety limits while preserving rich descriptions up to 8,000 characters per section.
- Token Deduplication: Normalizes positive and negative token arrays, trimming redundant commas and whitespace.
Common Import Errors and Quick Fixes
| Error Message | Cause | Quick Fix |
|---|---|---|
| 'Unexpected token in JSON' | The AI included conversational text before or after the JSON code block. | Copy ONLY the text inside the code block (starting with { and ending with }). |
| 'Positive prompt tokens required' | The AI left positiveTokens as an empty array. | Add 3 to 5 descriptive words separated by commas in the positive tokens field. |
| 'Image-generation instructions missing' | The AI omitted section 14 or left it blank. | Write a 1-sentence prompt directive describing how the image model should render the frame. |
| 'Unescaped double quote' | The AI used unescaped quotes inside a text string (e.g. "camera": "40mm "anamorphic" lens"). | Replace the internal quotes with single quotes ('anamorphic') or remove them. |
Editing Imported Specifications
After clicking Import and Validate JSON, the dialog switches to the specification preview. You can review and adjust any field directly before saving:
- Tweak the style name or add your channel brand name.
- Add custom color hex codes to the primary and accent color fields.
- Add specific negative exclusions (e.g. adding 'neon colors' to an earthy watercolor style).
- Adjust the image-generation and video-generation prompt prefixes.