Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:869413421 Ai moive studio Prompt Construction

From Leeroopedia
Knowledge Sources
Domains Prompt_Engineering, Generative_AI
Last Updated 2026-10-23 12:00 GMT

Overview

Technique for constructing structured, domain-specific prompts through template-based composition of style constants, scene context, character information, and technical specifications.

Description

Prompt Construction is the design pattern for building complex generation prompts from reusable, composable components. Rather than writing monolithic prompts, the pattern uses static template sections (CORE_STYLE, TECHNICAL_SPECS, FORBIDDEN_ELEMENTS) combined with dynamic context (scene description, character info, previous shot context) to produce a final prompt.

Two concrete implementations exist:

  • KeyframePromptBuilder: Constructs image generation prompts for movie keyframes. Combines live-action film aesthetic constants with shot description, dialogue hints, and forbidden element lists. Adapts forbidden elements based on whether the shot contains characters.
  • CharacterThreeViewPromptBuilder: Constructs three-view character reference sheet prompts. Uses a template with era background, occupation, and key visual traits to produce a prompt for generating front/side/back character reference photos.

Usage

Use this principle when generation prompts need consistent structure across many invocations. Apply when prompt components can be decomposed into reusable constants and variable context. Use when different generation contexts (with/without characters) require different constraint sets.

Theoretical Basis

# Abstract prompt construction pattern
CORE_STYLE = "Live-action film still, cinematic, natural lighting..."
TECHNICAL_SPECS = "Shot on Arri Alexa, 35mm lens, shallow depth of field..."
FORBIDDEN_ELEMENTS = "NO 3D render, NO CGI, NO game character style..."

def build_prompt(shot, scene, characters, previous_shot=None):
    if custom_prompt:
        return f"{custom_prompt}\n{CORE_STYLE}\n{TECHNICAL_SPECS}"
    context = build_scene_context(scene)
    prev_context = build_previous_shot_context(previous_shot)
    description = shot.shot or "A cinematic shot"
    forbidden = FORBIDDEN_ELEMENTS if has_characters else NO_PEOPLE_FORBIDDEN
    return f"{CORE_STYLE}\n{prev_context}\nSHOT DESCRIPTION:\n{description}\n{TECHNICAL_SPECS}\n{forbidden}"

Practical Guide

  • Separate prompt into static constants and dynamic context
  • Use class-level constants for style, technical specs, and forbidden elements
  • Adapt forbidden element lists based on shot content (with/without characters)
  • Include previous shot context for visual continuity
  • Support custom prompt overrides with style enforcement
  • Keep dialogue hints concise (first 100 chars)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment