Back to Case Studies
Enterprise

Advanced Prompting: Toon Styles & JSON Mode

Mastering the art of style-specific image generation ('Toon') and strict structured text generation ('JSON') to build reliable creative applications.

Sep 2025
11 min read
Advanced Prompting: Toon Styles & JSON Mode

Project Overview

Prompt engineering splits into two disciplines: Creative (Style) and Structural (Format). This case study covers both. Part 1 explores 'Toon' prompting—creating consistent 3D Pixar/Disney style characters. Part 2 explores 'JSON Mode'—forcing LLMs to output machine-readable code for API integration. Together, they form the basis of modern AI apps.

High
Consistency
100%
Parse Rate
3D/2D
Style
MJ/GPT
Platform

System Architecture

For Image Generation, we use a 'Style Token' approach, pre-defining a lexicon of lighting and render terms (e.g., 'Octane Render', 'Subsurface Scattering'). For Text, we utilize the model's native 'JSON Mode' combined with Zod/Pydantic schema definitions in the system prompt to guarantee valid syntax.

System Architecture
Figure 1: System Architecture Diagram

Style Prompt

Injecting aesthetic keywords (e.g., 'Pixar style', 'claymation').

Negative Prompt

Removing unwanted artifacts (e.g., 'low res', 'blurry').

System Instruction

Enforcing 'You are a JSON generator' behavior.

Schema Def

Providing the exact JSON structure expected in the output.

Implementation Details

Code Example

json
// System Prompt for JSON Mode\n{\n  "role": "system",\n  "content": "You are a character generator. Output JSON only. Format: { 'name': str, 'description': str, 'attributes': { 'strength': int } }"\n}\n\n// User Prompt for Toon Image\n"A cute robot gardener, 3D render, Pixar style, soft lighting, depth of field --ar 1:1 --v 6.0"

Agent Memory

Always provide a valid JSON example in the prompt. For images, use 'Image Prompting' (supplying a URL) to anchor the style if text alone isn't consistent enough.

Workflow

1

User Input: 'Make a funny cat character'.\n2. LLM (JSON): Generates character biography and stats in JSON.\n3. Parser: App reads JSON to get 'cat', 'orange', 'funny'.\n4. Prompt Builder: Constructs 'Funny orange cat, 3D toon style...'.\n5. Image Gen: Midjourney/DALL-E creates the visual asset.

Workflow Diagram
Figure 2: Workflow Diagram

Results & Impact

"Rigid JSON controls combined with creative style prompts allowed us to build an automated children's book generator that actually looks good."

Reliability

No more markdown or conversational filler in API responses.

Aesthetics

Consistent 'Toon' look across hundreds of generated assets.

Integration

Seamlessly fits into Javascript/Python logic.

About the Author

Vedant Pai, AI Context Engineer

Vedant Pai

AI Context Engineer

12+
Projects Delivered
1.5+
Industry Experience

Vedant Pai

AI Context Engineer

Apex Neural

Designs and deploys agentic AI that integrates LLM reasoning with structured backends. Work spans multi-agent orchestration (Planner/Executor/Verifier), ReAct pipelines, RAG with validation, and microservice deployments with JWT/RBAC.

Ready to Build Your AI Solution?

Get a free consultation and see how we can help transform your business.