Workflow

Einen Film mit mehreren Einstellungen inszenieren

Geschichte, Figuren, Referenzen, Storyboard, Prompts, Clips, Zusammenschnitt und zwei Untertitelspuren.

Agenten lesen diese Seite im Markdown-Format:https://aividart.com/docs/directing.md Markdown

Der Leitfaden ist für Agenten auf Englisch verfasst.

This guide is the working procedure for an agent directing a multi-shot film, animation, documentary, presenter video, commercial or MV through the AIVidArt API and ffmpeg. The agent develops the story, characters, dialogue, narration, locations, reference images, storyboard, prompts, jobs, edit and subtitles. The deliverable is the complete assembled film, with reviewed source-language and translated subtitles embedded as two selectable tracks. A collection of clips is not a finished production.

Read the API reference first: https://aividart.com/docs/api.md. Every request below follows it: upload inputs with POST /api/uploads, submit with POST /api/jobs, poll GET /api/jobs/{id}, download the outputs URLs. Results are deleted after 2 days, so download each accepted asset into the production folder at once.

1. Confirm the brief before production

Ask for the following together, reuse answers already given, and record them in 00_project.md:

Decision What to confirm
Subject and audience Story/topic, purpose, intended viewer, desired length, required content and constraints
Frame Landscape or portrait; recommend 16:9 for a film and 9:16 for mobile delivery
Resolution 768p by default; offer 544p when the user prioritizes speed
Video mode Reference mode by default; offer fast mode when the user wants maximum speed (see below)
Spoken language Confirm the default language of dialogue and narration; recommend Mandarin Chinese if appropriate
Visual treatment Anime/2D, stylized 3D, or realistic/live-action; recommend a treatment suited to the brief
Subtitle languages Source-language subtitles plus the user's requested translation language; ask which track should be default
GPU time Whether a GPU is already rented (GET /api/rentals/active); if not, how many hours the user agrees to rent. Renting spends credits, so never rent without the user's go-ahead

The two video modes:

Mode API How it works 15 s at 768p Trade-off
Reference mode (default) mode: "r2v" Each job receives the frozen character and location images as ref_image and composes the shot itself ~195 s Identity is held by the references throughout the shot; the model decides the exact framing
Fast mode mode: "i2v" Each job starts from a first frame, either the previous clip's last frame or a composed picture ~128 s About 1.5× faster and gives exact control of the opening frame, but identity, cast and set are only as good as each first frame: it depends heavily on the picture model composing every shot correctly

Recommend reference mode unless the user asks for speed above all. Within a fast-mode film, a single shot the picture model cannot compose reliably may still be rendered in reference mode (section 7).

Estimate GPU time before renting: count the segments, multiply by the per-clip render time above (scaled by length), add pictures (a few seconds each), takes you expect to redo and the final transcription, and propose a rental length to the user. Jobs left queued when a rental ends wait for the next rental.

Recommend a specific visual direction with a reason rather than offering only a list of styles. For example, a folklore adventure may suit stylized animation and a present-day suspense story may suit cinematic realism. Do not silently choose the spoken language or the translation language. Do not start image/video generation until the required settings are settled.

2. Create the production folder and write the whole story first

Create a new local folder outputs/<title>/ for this production; do not overwrite another production. Use a meaningful title, with a suffix if necessary. All generated files and supporting records stay here.

outputs/<title>/
  00_project.md             brief, confirmed settings, premise, complete plot, style and delivery plan
  01_bible.md               characters, voices, dialogue, narration, locations and continuity rules
  02_storyboard.md          complete numbered shot list and transitions
  03_reference_manifest.json  selected reference files, versions, roles, job IDs, seeds and upload URLs
  04_generation_log.md      takes, QC, continuity problems and fixes
  PROGRESS.md               current state and exact next steps for another session
  refs/characters/          fixed character images and explicit costume/age variants
  refs/locations/           fixed empty sets and consistent views of them
  refs/shots/               reference mode: optional compositions derived from the fixed references
  refs/firstframes/         fast mode: selected first frame of every segment (composed or chained)
  refs/candidates/          unselected image candidates
  frames/                   fast mode: last frames extracted from accepted clips for chaining
  prompts/images/           exact reference-image generation/edit prompts
  prompts/video/            exact video prompts, one file per segment
  clips/                    accepted segments; rejected/ keeps replaced takes
  qc/                       contact sheets and continuity checks
  scripts/                  prompt builder, API client, assembly and subtitle helpers
  jobs.json                 image/video/ASR requests, input order, IDs, seeds and outputs
  subs/                     raw ASR, reviewed source SRT, translation SRT and correction log
  previews/                 optional assembly checks
  <title>.clean.mp4         final picture/audio edit before subtitle muxing
  <title>.mp4               delivered film with two embedded subtitle tracks
  cover.png                 title poster; first frame of clips/S00_opening.mp4
  publish.md

Keep reusable scripts in English. Production notes may use the user's language; video prompts use English descriptions with dialogue in its actual spoken language.

Before storyboarding or generating reference images, write down:

  1. Story: logline, setting, stakes, complete beginning/middle/end, emotional arc and approximate runtime.
  2. Opening: an arresting image, event, question or contradiction in the first 5–15 seconds. Introduce enough context to understand the stakes without a long exposition dump. Deliver on the opening's promise later.
  3. Characters: names, motivation, relationships, age, build, face/hair, costume, distinctive marks and props.
  4. Dialogue: exact words, speaker, intention, emotional delivery and story function. Keep voices distinguishable.
  5. Narration: whether it exists, narrator identity, perspective, fixed voice and exact lines. Avoid explaining everything already visible; use narration for context, tension or information the image cannot convey.
  6. Locations: architecture, floor plan, landmark positions, entrances, materials, palette, lighting, time, weather and recurring sound. Track intentional changes to a location's state.
  7. Film language: a fixed palette, contrast, lens/framing tendencies, camera behavior, texture and sound strategy.

Work with the deliberate composition, color dramaturgy and spatial storytelling associated with Zhang Yimou, and the clear action geography, physical cause and effect and large-scale reveals associated with James Cameron. Turn these references into concrete direction appropriate to this story. A director's name alone is insufficient. Use an intentional visual grammar throughout rather than changing style with every scene.

Write the full plan first, then proceed through storyboard, reference production, video generation and delivery. There is no mandatory approval gate. Honor any review checkpoints the user actually requests; otherwise continue through the authorized production and keep the user informed.

3. Build the storyboard and allocate time

Divide the complete story into 5–15 second segments, each generated as one continuous shot. Choose durations for the content; do not force every segment to 15 seconds. Repeated uses of [Shot 1] in separate jobs are correct: each job starts its own local timeline.

Each storyboard entry must contain:

  • Segment ID, requested seconds, expected frames, actual seconds and position in the final edit.
  • Story purpose and new information; reference IDs for cast, location and any essential prop.
  • Fast mode only: first-frame source, chain:<previous segment ID> (the previous accepted clip's last frame) or compose (a new composed first frame, listing the character and location references it is built from).
  • Opening state: character placement, gaze, pose, prop ownership, movement, light and camera orientation. In fast mode this is the first frame; for a chained segment it is whatever the previous clip actually ends on.
  • Composition: shot size, viewpoint, lens feel, foreground/midground/background, focus and motivated camera move.
  • Timed action: start, development, consequence and reaction, with precise physical and visual details.
  • Exact dialogue/narration, speaker IDs, voice descriptions, delivery and allocated speaking windows.
  • Synchronous effects, ambience and any score description.
  • Closing state and the next segment's opening; cut motivation and continuity requirements.

Speech and action budget

These are conservative planning heuristics, not model guarantees. For Mandarin, start at about 3 Chinese characters per spoken second; allow extra time for emotion, turns, breaths and action. For English, start around 2–2.5 words per spoken second, then adjust for the voice and complexity. Calculate speech time + pauses + non-overlapping action + opening/ending handles <= actual segment duration. Dialogue and narration share the budget. Do not count overlapping speech as extra capacity.

Requested length Initial Mandarin budget, total across all voices Practical action plan
5 s About 8–12 characters; normally one brief line One clear action or reaction
10 s About 20–25 characters; one or two short lines One main action with a readable response
15 s About 30–40 characters; two or three short turns Two or three connected beats, with a visible outcome

An action-heavy segment needs less speech. A quiet monologue can use more of the timeline, but avoid filling its final fraction of a second with words. Reserve roughly 0.5–1 second at boundaries where useful. If a segment is overloaded, shorten its words or split it; do not solve it by demanding rushed delivery. Describe rich texture, micro-expressions, material response and light without inventing too many actions for the allotted seconds. One camera path and clear causal progression are usually easier to read.

The service snaps frames to a 17k+5 grid at 24 fps. Plan to the actual duration rather than the requested integer:

def frames(seconds):
    n = max(5, round(seconds * 24))
    return n + (5 - n % 17) % 17

Examples: 5 s -> 124 frames (5.1667 s), 10 s -> 243 (10.125 s), 12 s -> 294 (12.25 s), 15 s -> 362 (15.0833 s). Verify actual output frames before final assembly and subtitle review.

Design the joins before rendering

Keep a continuity ledger for each neighboring pair: screen direction, eyelines, axis, pose, speed, prop state, geography, lighting and sound. Write how the outgoing state leads into the incoming state. Use motivated reaction cuts, matched motion, a reveal/payoff, or an establishing shot for a location change. Maintain the 180-degree axis unless the change is deliberately established. Avoid repeating the same action on both sides of a cut or teleporting a prop between hands.

Separate jobs do not share audio buffers or motion state. A prompt cannot guarantee a seamless voice or music bridge between them. Finish a sentence within its segment; place cuts at natural pauses or sound events. Use the same ambience and score specification, but review the assembled result for restarts and tonal jumps. If necessary, simplify the music or choose a quiet cut rather than claiming the score will be sample-continuous.

Fast mode: chain or compose each join

In fast mode, decide for every join whether it is continuous or a cut:

  • Continuous (the same action, take or camera move carries on, with no change of angle): chain it. The next segment's first frame is the previous accepted clip's last frame (section 7). Write the outgoing segment's ending as a usable still: a settled pose, eyes open, mouth closed, no motion blur, no fast pan in the last second, every needed character fully in frame. Chaining keeps people, set, light and props exactly where they were; the model cannot know what happened before the frame, so restate it in the next prompt. Chain only when the last frame shows both the characters the next segment needs (faces readable) and the set. If the clip ends on an empty set, a close insert, a back view, a character off frame or a face too small or blurred to carry identity, do not force continuity: the next segment would invent the missing person. Make it a cut with a composed first frame instead, and accept the small discontinuity.
  • Cut (new angle, new location, time jump, or a character who must stay recognisable but whose framing changes): compose a new first frame from the frozen references with a picture edit (section 4).

Limit chains to about three or four consecutive segments. Every generation re-encodes the picture, and faces, textures and costume details drift a little each time. Break a long continuous scene with a motivated cut to a freshly composed frame (a reaction shot, insert or reverse angle) to re-anchor identity, then chain again.

4. Generate and freeze character and location references

Lock character appearance first. Lock each location before rendering a video set there. In reference mode these images go to the video jobs. In fast mode they are not sent to the video model; they are the inputs from which each segment's first frame is composed, which then carries identity and set. Principal and recurring characters need independent reference cards; one-off supporting characters, passersby and background crowds may be described directly in video prompts without separate cards. Register a stable reference if an incidental character recurs later.

For a novel, search and reuse the shared library under outputs/<novel-title>/refs/ before generating assets; all selected character and location images must remain within that novel folder, accessible across chapters. For a standalone short story, keep the same necessary library within its own production folder. The reference manifest must be searchable by stable identity/location ID, name/alias, version, traits/state, chapter/scene applicability and local image path, alongside the generation records. Record the exact selected versions in each segment's job manifest.

Pictures come from one picture model with two modes: t2i creates a picture from text, i2i edits or composes from one to four input pictures and keeps the canvas of the first input.

Pick one coherent rendering style for both people and environments. Produce a small candidate set, inspect it, and select a canonical image for each required character card and location. Store the file, prompt, job ID, seed, version, result URL and intended role in the manifest. A repeated seed alone does not establish identity.

Character references: one clearly visible person per selected image, readable face, proportions, hair, costume and distinctive marks; neutral expression, unobstructed hands where relevant, plain background. Prefer a clear full/three-quarter view; create a closer face view only when needed. Derive new views and costume variants from the selected canonical image using picture edits rather than independently reinventing the character. Check identity after every edit. For characters with cards, growth, aging and any change of clothing/accessories require a new reference version before the affected video is generated, even for a brief costume change. Record the applicable chapter/scene range, preserve the old image and never overwrite a version used in a finished video. One-off extras remain covered by the prompt-only exception above.

Location references: an empty set without incidental people, readable layout and landmarks, stable materials/colors, agreed lighting and weather. Write a simple spatial plan. Derive reverse angles and details from the canonical view, then check that doors, windows, stairs and props occupy compatible positions. Reuse these images across chapters; register derived versions for changed lighting, weather or set state. Empty sets prevent background people from competing with the intended cast references.

Example text-to-picture request (use the confirmed aspect ratio):

POST /api/jobs
{"kind":"image","mode":"t2i",
 "params":{"prompt":"<contents of prompts/images/location_workshop.txt>","aspect_ratio":"16:9"},
 "inputs":{}}

For a derived view, pass the canonical reference (its upload URL, or the result URL of the job that made it):

POST /api/jobs
{"kind":"image","mode":"i2i",
 "params":{"prompt":"<contents of prompts/images/workshop_reverse.txt>"},
 "inputs":{"ref_image":["<URL of refs/locations/workshop.png>"]}}

Poll until complete and download outputs.image. Reference prompts must describe the actual character or set in full, including the production's visual treatment. Do not send storyboard placeholders to the API.

Shot compositions (reference mode): when placement is complex, derive a single composition from selected character and location images with a picture edit (at most four inputs). Record what it controls and verify that it has not changed faces, costume or geometry. It remains a reference, not a guaranteed first frame.

Use only necessary references in a reference-mode video job: normally one or two characters plus one location; the API accepts at most six pictures. Even establishing shots carry their location reference. Freeze selected assets before bulk video submission (or, in fast mode, before composing first frames). Do not silently replace a canonical reference halfway through the production.

Fast mode: compose the first frame of every compose segment

Fast mode stands or falls with these pictures. The video model sees only the first frame, so a wrong face, a merged or duplicated person, a missing character, a prop in the wrong hand or a distorted set goes straight into the clip. Inspect them as carefully as finished shots.

Before any video job, fix the first frame of every segment whose source is compose. Use an i2i edit with the empty location image first (generated in the film's aspect ratio, it sets the canvas), then the one to three character cards in the shot (at most four inputs in all). Write prompts/images/firstframes/<segment>.txt describing exactly the storyboard's opening state:

  • who is in frame and where (left/right, foreground/background, distance from camera), referring to each input as "the woman from image 2" and naming her costume, so the right person lands in the right place;
  • pose, gaze, expression, hand positions and who holds which prop;
  • shot size, camera height and angle, lens feel and depth of field;
  • the location's light, time of day and weather as in the bible, and the production's visual treatment;
  • a resting moment rather than peak action, so the video has room to start the movement;
  • "no readable text, letters, subtitles, logos or watermarks"; never mention a phone or screen unless one belongs in the shot.

A shot with no principal character (an establishing view, an insert, a crowd) edits from the location image alone, or uses t2i at the film's aspect_ratio when no location card applies. One-off extras are described in the first-frame prompt; they need no card.

POST /api/jobs
{"kind":"image","mode":"i2i",
 "params":{"prompt":"<contents of prompts/images/firstframes/S001.txt>"},
 "inputs":{"ref_image":["<URL of refs/locations/workshop.png>","<URL of refs/characters/lin.png>"]}}

Generate two candidates per segment (two jobs with different seeds), inspect them on a contact sheet and select one into refs/firstframes/<segment>.png; keep the others in refs/candidates/. Check each face and costume against its card, the set's landmarks against the location image, the cast count, prop ownership, hands and the absence of text. Fix a near miss with a further edit of the chosen frame ("the same picture, but she holds the lamp in her right hand") rather than recomposing from scratch. Record the inputs and their order, prompt, job ID, seed and result URL in 03_reference_manifest.json. All compose frames are independent of each other and of the video jobs, so compose them all up front, before submitting video. If a shot still fails after a few candidates and a repair edit (typically three or more principal characters, close physical interaction, or an unusual angle), render that shot in reference mode instead of forcing a weak frame.

Chained segments get their first frame only after the previous clip is accepted (section 7). If an extracted last frame has a soft face, a blink or a broken hand, a light edit with the relevant character card as the second input may repair it; otherwise cut to a composed frame instead.

5. Fix voices in the bible and repeat them in video prompts

For every speaking character and narrator, define a stable speaker ID such as (S1), fixed English voice description and a user-readable description. Specify age/gender where relevant, pitch, timbre, resonance, pace, articulation, accent/language and habitual delivery. Keep each voice clearly distinguishable. The narrator is a separate speaker even when never visible.

Repeat the same voice string at every relevant vocal event, followed by the exact words to say. Emotion may change locally; identity should not. Generate dialogue and narration inside the video job; do not substitute separately generated speech. Voice wording encourages consistency but is not a speaker embedding or a guaranteed voice lock. Review drift and revise problematic takes if needed.

6. Video prompt design: the official format and the project template

The rules below are the official prompt format of the video model, embedded here so routine production does not need another source. The timing budgets, reference-lock and first-frame procedures and continuity ledger above are production conventions.

Official format essentials (reference mode)

Use six English sections, in this order: subject_definitions, summary, retention_analysis, detailed_description, overall_soundscape, non_diegetic_music.

Define each referenced entity and its role. <Subject N> names reusable visible content, including a location; <Picture N> identifies an input picture. Keep meanings consistent. Use [reference generation] for this task. Retention markers include fully_preserved, partially_preserved, attribute_transfer, weak_reference; choose according to the defined role. A person reference can preserve identity without preserving its backdrop.

Rules shared by both modes

Introduce style before [Shot 1]. The first shot has no timestamp; later shot markers denote actual cuts, not action phases. Describe composition, environment, light, action, state changes, camera and synchronized sound.

Give voices stable (S1) IDs. Write camera movement naturally, with scale/speed where useful. Keep delivery instructions outside <d>; put the language and exact spoken words inside: <d>[Chinese] ...</d>. For voiceover use says in an off-screen voiceover; keep visible non-speakers' lips closed. Within one job, <scenetrans> denotes speech spanning a cut; <cutoff> denotes speech truncated at the end. Neither creates continuity between separate API jobs.

overall_soundscape covers ambience, physical effects and nonverbal sounds; do not repeat dialogue there. non_diegetic_music describes instrumentation, tempo and dynamics, or N/A for no background score.

Implementation rules

Build prompts from a script and the frozen bible; do not paraphrase identities/voices independently per job. Project asset IDs stay global, but <Picture N> always follows the order of the ref_image list in that request. Maintain an explicit mapping from project assets to prompt labels in jobs.json. Speaker IDs remain stable throughout the film. The prompt builder must resolve every placeholder before submission.

Each segment has one [Shot 1]; express its action phases in prose with local elapsed times. Do not use the old [Shot 1, 00:00-00:05] syntax. State the actual segment duration (in summary in reference mode, in the [Shot 1] sentence in fast mode). Make every important action observable: which hand, which object, where it moves, what resists, what changes, and how the character reacts. Establish spatial anchors before moving the camera. Specify gaze, breathing, fabric, weather, reflections and focus changes when they contribute to the moment. Avoid contradictory camera commands and details that cannot be seen at the chosen framing.

Keep shots free of readable text, subtitles, logos and watermarks unless the brief requires otherwise. Subtitle delivery happens after assembly. Reference images normally supply appearance/layout rather than exact first/last frames. Do not describe a neutral character portrait as the location of the story. In r2v use ref_image (and ref_video), never image or last_image; the API refuses mixing them. An extracted accepted frame may be an additional continuity reference, but does not enforce a first frame.

Complete original example (reference mode): one character plus one location

This illustrative segment assumes Mandarin, 16:9, a 10 s request (10.125 s actual), character image first and empty location image second. Its spoken line, action budget and final gaze set up a reaction cut. Replace the sample cast/set with the project's canonical descriptions; do not add unrelated image references.

subject_definitions:
<Subject 1> is Lin, a woman in her early thirties with a narrow face, straight black chin-length hair, a small notch in her left eyebrow, a charcoal cotton jacket and a faded rust scarf, shown in <Picture 1>. This image supplies her identity and costume only.
<Subject 2> is the empty mountain radio workshop shown in <Picture 2>, with a north-facing rain-streaked window on screen left, a scarred oak workbench beneath it, an unlit brass desk lamp, and a green steel door on screen right. This image supplies the room layout, materials and lighting.

summary:
[reference generation] A continuous 10.125-second shot follows <Subject 1> finding an impossible signal inside <Subject 2>. Her attention shifts from the radio to the closed door.

retention_analysis:
<Subject 1> (appears in [Shot 1]): fully_preserved - Keep Lin's facial proportions, eyebrow notch, haircut, jacket and rust scarf; the portrait background is not part of her reference role.
<Subject 2> (appears in [Shot 1]): fully_preserved - Keep the workshop's window, workbench, lamp and door in their established spatial relationship, with the same wet surfaces and cool daylight.

detailed_description:
Cinematic realism with restrained slate blue and rust colors, soft overcast window light, natural skin texture and gentle highlight roll-off. No readable text, subtitles, captions, logos or watermarks.
[Shot 1] A medium close view places <Subject 1> in the left half of the frame at the workbench in <Subject 2>. The green door remains visible on the right, separated from her by negative space. Her left hand rests beside the radio; her right thumb and forefinger hold its tuning dial. Her scarf is damp against the collar. A slow, short push toward her face preserves the door in the background and keeps the camera on the room's established side of the axis.
During the first two seconds she rotates the dial a few millimeters. The worn knob offers slight resistance; the radio casing stays planted beneath her left palm. A thin electrical whistle breaks through the static. Her fingers stop immediately, while one bead of rainwater slips from her sleeve onto the oak surface.
Between two and four seconds she leans closer without changing her grip. Her lower eyelids tighten; her mouth stays closed as she listens. Focus eases from the tuning fingers to her eyes, while the cool window reflection remains visible along her cheek. The door stays softly legible behind her.
Between four and six seconds, <Subject 1>, in the low, lightly husky voice of an adult woman, speaking Mandarin Chinese with deliberate articulation and an unhurried pace (S1), says quietly: <d>[Chinese] 这不是求救,是警告。</d> Her delivery is controlled, with a short pause at the comma; her lips follow this line only. The dial remains still throughout the sentence.
From six seconds onward, a single dull knock comes from the door on screen right. She closes her mouth, holds her breath, then turns only her head and eyes toward it. Her shoulders remain angled toward the bench and both hands retain their positions. The camera slows to rest. In the final second she holds the rightward gaze, leaving the door shut and space on screen right for the following segment's view of the threshold. There is no internal cut, no extra speech and no change to another room.

overall_soundscape:
Fine rain taps the window above a low room tone. Radio static briefly narrows into a whistle, a droplet touches wood, and one muted knock sounds at the green door. A faint breath stops after the knock.

non_diegetic_music:
N/A

For a narrator, use the fixed voice at the timed narration event, for example:

The unseen narrator, in the warm, low-register voice of a middle-aged man, speaking Mandarin Chinese with measured articulation and a steady pace (S2), says in an off-screen voiceover: <d>[Chinese] 门外的人,已经等了三十年。</d> Lin's lips remain closed throughout the narration.

Do not add this example narration to the sample segment without recalculating its time budget.

Fast mode prompt layout

A first-frame segment uses three English sections after one opening line, with no subject_definitions, summary or retention_analysis: the frame itself carries identity and set.

<Picture 1> is the first frame: <one sentence describing what the frame actually shows>

detailed_description:
<style line> [Shot 1] ...

overall_soundscape:
...

non_diegetic_music:
...

<Picture 1> is the input first frame. The service prepends the official keyframe tag ("at 0.00 seconds into the target video, <Picture 1> (from [Shot 1]) is fully referenced") when the prompt lacks one. The model knows nothing beyond the frame and the prompt, so name each visible person by name plus costume or position ("Lin, the woman in the charcoal jacket on the left") instead of <Subject N>, and keep that wording stable across the film.

Write the prompt from the selected first frame, not only from the storyboard. Look at the chosen refs/firstframes/<segment>.png (or the extracted last frame) and start [Shot 1] from what it shows: who stands where, who holds what, where they look. If the frame differs from the plan in a harmless way, change the prompt to match the frame. For a chained segment, say in one clause what was just happening ("still kneeling where she stopped the dial") so the movement continues rather than restarts. The first frame must not contain text either. Use image only in these jobs; do not add ref_image.

The example segment above in fast mode, with its first frame composed from the empty workshop image and Lin's card, begins:

<Picture 1> is the first frame: Lin, a woman in her early thirties with straight black chin-length hair, a charcoal cotton jacket and a faded rust scarf, sits at the scarred oak workbench under the rain-streaked window of the mountain radio workshop, her right hand on the radio's tuning dial, the green steel door visible on the right.

detailed_description:
Cinematic realism with restrained slate blue and rust colors, soft overcast window light, natural skin texture and gentle highlight roll-off. No readable text, subtitles, captions, logos or watermarks.
[Shot 1] A continuous 10.125-second medium close shot starting exactly from <Picture 1>, with no cuts. Lin stays in the left half of the frame; the green door remains visible on the right, separated from her by negative space. ...

The timed action, speech, overall_soundscape and non_diegetic_music stay as in the reference-mode example, with "Lin" in place of <Subject 1>.

7. Submit video jobs through the API

Keep the API key in the environment (AIVIDART_API_KEY); never write it into production files. There are no model, sampler or step fields: each mode has its fixed setup.

Reference mode

Use mode: "r2v" for every segment, resolution: "768p" unless confirmed otherwise, the confirmed aspect ratio and the frozen references.

POST /api/jobs
{"kind":"video","mode":"r2v",
 "params":{"prompt":"<contents of prompts/video/S001.txt>","resolution":"768p","aspect_ratio":"16:9","duration":10},
 "inputs":{"ref_image":["<URL of refs/characters/lin.png>","<URL of refs/locations/workshop.png>"]}}

This makes <Picture 1> Lin and <Picture 2> the workshop. Save the request, ordered reference mapping, job ID, seed, prompt path, duration and later output path in jobs.json immediately after submission. The ref_image order must match the prompt; do not rely on filenames to convey reference roles.

Multiple ready segments may be submitted together: each is a separate POST, and the jobs run in submission order on the rented GPU. Finish reference dependencies first; independent segments can be queued immediately (at most 200 jobs pending at once).

Fast mode

Use mode: "i2v" for every segment, resolution: "768p" unless confirmed otherwise, aspect_ratio: "image" and the segment's selected first frame as image.

POST /api/jobs
{"kind":"video","mode":"i2v",
 "params":{"prompt":"<contents of prompts/video/S001.txt>","resolution":"768p","aspect_ratio":"image","duration":10},
 "inputs":{"image":["<URL of refs/firstframes/S001.png>"]}}

Save the request, first-frame path and its source (compose job ID or chain:<segment>), job ID, seed, prompt path, duration and later output path in jobs.json immediately after submission.

Chained segments. When the previous segment's clip is accepted, extract its very last frame at full resolution, upload it (purpose=image) and use it as the next segment's first frame:

ffmpeg -y -sseof -0.5 -i clips/S003.mp4 -update 1 frames/S003_last.png
cp frames/S003_last.png refs/firstframes/S004.png

Inspect the extracted frame before submitting (face, hands, blur, blink). If it lacks a character the next segment needs, or the set, or a face is unreadable, switch that segment to compose (section 4) and update the storyboard; do not chain from it. Otherwise write the next prompt from it (section 6). A chain is strictly sequential: S004 cannot be submitted before S003 is done and accepted, and a redone S003 invalidates S004's frame.

Queueing. Every compose segment and the first segment of every chain depend only on frozen first frames, so submit all of them together as soon as their frames are selected. Feed the chained segments in as their predecessors finish. Interleaving several independent chains keeps the GPU busy.

Hard identity shots. If the picture model cannot compose a reliable first frame, or a first frame cannot hold a face through the action (a long turn away and back, a character entering from off frame, a large crowd around the lead), render that one segment in reference mode with the reference-mode prompt format. Log why. Its look differs slightly from the fast-mode shots, so review the joins on both sides.

Polling (both modes)

Never duplicate jobs just because a request timed out; list the recent jobs (GET /api/jobs?kind=video) and reconcile with jobs.json first. Poll GET /api/jobs/{id} about every 15 seconds in a background helper, download outputs.video on succeeded, and log failed / canceled results with their error. A queued job whose error says the rental ended is waiting for the next rental, not failed. Keep updates to the user going during long waits, and watch the rental's ends_at: ask the user about extending before a batch would outrun it.

8. Review segments and their joins

Create contact sheets (including beginning/end frames) and check audio presence/duration. For example:

ffmpeg -i clips/S001.mp4 -vf 'fps=1/2,scale=320:-1,tile=8x1' -frames:v 1 qc/S001.jpg
ffmpeg -i clips/S001.mp4 -af volumedetect -vn -f null -

Check identity/costume, location geometry/light, intended action and reaction, prop states, anatomy, unwanted text, timing and opening/closing state. Review adjacent clips together, not only in isolation. In fast mode, compare the faces in the last link of each chain against the character cards; if drift is visible, end the chain earlier and re-anchor the next segment with a composed frame. A chained segment's last frame must also pass the first-frame check, since it becomes the next segment's start. Inspect speech completeness later against the ASR result as well. Text and frame inspection cannot fully judge pronunciation or exact voice timbre; describe the verification actually performed and invite listening feedback where needed, without abandoning the remaining production work.

Redo missing story actions, wrong/duplicated characters, broken anatomy, obvious set discontinuities, truncated essential speech or unwanted burned-in subtitles. Tighten the direction or timing when the problem is structural; changing a seed alone may not fix it. Keep rejected takes and log the replacement. Do not cancel a healthy running job just to speed iteration. Fix a recurring issue in the bible/builder before generating more affected shots. Preserve acceptable minor variations rather than chasing endless takes.

If the delivery needs more than the native resolution, upscale each accepted clean segment now, on the same GPU and before captions or titles are added: see https://aividart.com/docs/upscale-finishing.md.

9. Make the title cover and animated opening

Every film opens with a 3–5 second animated title shot, like the opening card of a feature film. Make it after the references and the style are frozen, and before assembly.

Cover picture. Write prompts/images/cover.txt and generate cover.png with an i2i picture edit, using the frozen references as ref_image inputs so the principal character(s), costume, set and style match the film; put the location (or another image with the film's aspect ratio) first, because an edit keeps the first input's canvas. Design it as a poster that stops the scroll:

  • one strong, simple composition: the protagonist in a characteristic pose in the key location, with a clear focal point and room for the title (rule of thirds, not a centered passport photo);
  • strong light and color dramaturgy, for example a single warm pool of light against a cold surrounding;
  • the film title as large, legible lettering in a style that suits the story (brush calligraphy, storybook type, bold poster lettering); spell out the exact title in quotes and say nothing else should be written;
  • a hint of the story's question or tension, without spoiling the ending.

Check the title spelling, the faces against the references and that no other text or logo appeared. Generate a few candidates if needed, keep the rejected ones in refs/candidates/ and record the prompt and job in jobs.json. The same cover.png is the publishing thumbnail/poster.

Animated opening. Animate the cover in first-frame mode as prompts/video/S00_opening.txt, saved as clips/S00_opening.mp4:

POST /api/jobs
{"kind":"video","mode":"i2v",
 "params":{"prompt":"<contents of prompts/video/S00_opening.txt>","resolution":"768p","aspect_ratio":"image","duration":5},
 "inputs":{"image":["<URL of cover.png, or the cover job's outputs.image>"]}}

duration is 3–5 seconds; the frame count snaps to the 17k+5 grid as usual. The prompt starts from <Picture 1> (the keyframe tag is added if it is missing), describes the cover in one sentence and then one continuous shot with no cut:

  • a very slow, smooth push-in of a few percent;
  • gentle ambient motion that belongs to the picture (steam, mist, leaves, light flicker, hair or fabric in the wind) and at most one small character gesture such as lifting the eyes;
  • the title lettering stays perfectly still, sharp and legible for the whole shot, never morphing or moving with the scene, and no other text appears;
  • overall_soundscape: one opening hit (bell, gong, chord or a sound from the story's world) over quiet ambience, no speech; non_diegetic_music: a short opening sting in the film's musical idiom.

Review it like any segment, with extra attention to the title: redo once with less motion if the lettering warps, flickers or gains extra characters. Check its loudness against the first story segment and raise the opening's audio during assembly if it is noticeably quieter.

10. Assemble the entire film

Assemble clips/S00_opening.mp4 followed by all accepted segments in story order into <title>.clean.mp4, at 24 fps. Normalize frame timestamps with setpts=N/24/TB, set square pixels, and pad/trim each segment's audio to its video frame duration before concat. Re-encode picture/audio for this assembly; concat demuxer plus stream-copy can retain AAC priming and cause sync errors. Avoid per-shot loudness normalization, which can lift quiet noise floors.

The helper should use an argument array (for example Python subprocess.run([...], check=True)) so paths with spaces are safe. For segment i, compute d_i = counted_video_frames / 24 and build:

[i:v]setpts=N/24/TB,setsar=1[v_i];
[i:a]asetpts=PTS-STARTPTS,apad=whole_dur=d_i,atrim=0:d_i[a_i];
...
[v_0][a_0][v_1][a_1]...concat=n=SEGMENT_COUNT:v=1:a=1[v][a]

These are filter templates: substitute numeric indexes, durations and count before running ffmpeg. In fast mode a chained segment's first frame is the previous clip's last frame, so drop it to avoid a one-frame freeze at the join: use trim=start_frame=1,setpts=N/24/TB for its video and atrim=start=1/24,asetpts=PTS-STARTPTS before the pad/trim of its audio, with d_i = (counted_video_frames - 1) / 24. Use -fps_mode cfr -r 24 -c:v libx264 -crf 16 -preset slow -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart. Do not rebuild the final movie from already encoded preview assemblies.

Verify with ffprobe: 24/1 frame rate, final frame count equals the accepted segments' sum minus one per chained join, expected resolution/orientation, and matching audio/video duration within codec/container rounding. Watch the joins for rhythm and continuity. Finish the edit before transcription so subtitle timestamps follow the deliverable.

11. Transcribe the assembled film

Use the transcription job (kind: "asr"), not a separate speech recognizer or a script-derived subtitle track. Upload the completed film (or losslessly extracted audio from that exact edit) with purpose=media, then submit:

POST /api/jobs
{"kind":"asr","mode":"asr",
 "params":{"language":"Chinese","timestamps":"word","file_name":"<title>.clean.mp4"},
 "inputs":{"media":["<upload URL of <title>.clean.mp4>"]}}

Substitute the source language. Poll the returned job. Download every URL in outputs.transcripts (json, words, srt, txt, vtt where present) and retain raw results in subs/. Word timing comes from forced alignment; exported cues must be based on real aligned spans. Never invent word timestamps by evenly spreading characters.

The limit is 2 hours and 256 MB per upload. If the film exceeds it, extract consecutive audio chunks from the final edit, preserve their exact start offsets, transcribe them the same way and combine timings. If the whole-film result has local alignment problems, re-transcribe the affected final-edit interval and apply its exact offset rather than reverting to approximate script timing. If timed exports are missing, investigate the failure before delivering subtitles.

12. Review, correct and translate subtitles

The agent reviews the transcript itself against the final clip sequence, dialogue/narration script, names, context and available audio evidence. Fix unreasonable recognition errors, punctuation, homophones, proper names, repetitions and silence hallucinations. The transcript describes what was actually spoken: do not restore a scripted line the model omitted, replace an audible paraphrase with the planned wording, or invent speech to fill a quiet passage. Flag unresolved ambiguity and recheck that interval. Regenerate a segment if essential story information was never spoken, then reassemble and refresh affected timings.

Save subs/source.reviewed.srt and a correction log containing original text, corrected text, time and reason. Keep trustworthy word/segment boundaries, split at sentence/phrase boundaries and meaningful pauses, and check subtitle onset/offset at scene changes. No negative, reversed, overlapping accidental or out-of-range cues; keep readable line lengths and display times. Avoid exposing internal speaker IDs as subtitle text.

Translate the reviewed transcript yourself into the user's requested subtitle language, using the story and character context. Keep names, terminology, tone and implied meaning consistent. Do not translate the unreviewed ASR. Save subs/translation.<language>.srt with matching cue IDs and times; adapt wording and line breaks for readability without changing meaning. Review both tracks for omissions, hallucinations, name consistency, punctuation and the chosen target language.

13. Embed two selectable subtitle tracks and deliver

Embed the source and translation as two separate soft subtitle streams, never burn text into pixels. Standard players usually display one selected stream at a time; two embedded tracks do not imply simultaneous bilingual display. If the user requests simultaneous display, clarify that additional presentation requirement.

Example for Chinese source and English translation (replace languages, titles and default selection with the confirmed settings):

ffmpeg -i '<title>.clean.mp4' -i subs/source.reviewed.srt -i subs/translation.en.srt \
  -map 0:v:0 -map 0:a:0 -map 1:0 -map 2:0 \
  -c:v copy -c:a copy -c:s mov_text \
  -metadata:s:s:0 language=zho -metadata:s:s:0 title='Chinese (Original)' \
  -metadata:s:s:1 language=eng -metadata:s:s:1 title='English' \
  -disposition:s:0 default -disposition:s:1 0 \
  -movflags +faststart '<title>.mp4'

Use a different output path from the input. Verify with ffprobe that there are exactly the intended video, audio and two subtitle streams, correct language tags/titles/default disposition, unchanged video frame count and duration, and no subtitle extending past the edit. Check switching and hiding subtitles in a player, and inspect several cues near the beginning, middle, end and cuts for sync. Keep both SRTs for platforms that accept sidecar subtitles. Subtitle muxing must not re-encode the final picture/audio.

Use cover.png from section 9 as the poster/thumbnail; it is the one image allowed to carry the title, since story shots have no burned-in text. Write publish.md with title, concise description, AI-generation disclosure, 8–12 appropriate hashtags, runtime, resolution and subtitle languages.

Deliver the film path, cover, publish notes and both SRTs, plus a brief account of actual QC and any unresolved issues. Update PROGRESS.md and the job log so another session can reproduce or revise any segment. Remind the user that the service deletes jobs and files after 2 days: everything needed is in the local folder.