Building a Reusable AI Video Prompt Pipeline with Python
Creating an AI video is easy.
Creating fifty videos that all follow the same visual style is much harder.
This became obvious during a recent internal project. We needed to generate a collection of short product videos. Every video shared the same visual identity, camera language, pacing, and lighting, but each one described a different feature. At first, we simply wrote a new prompt for every video.
It worked—for a while.
As the number of videos increased, prompt quality became inconsistent. Some outputs looked cinematic, while others felt completely different even though the prompts were only slightly changed. Updating the visual style meant editing dozens of prompts manually, and every teammate described scenes in their own way.
Instead of continuing to optimize individual prompts, we changed the workflow entirely.
The prompt became structured data rather than a long paragraph.
The Original Workflow
Our first workflow looked something like this:
Idea ↓ Write Prompt ↓ Generate Video ↓ Review ↓ Rewrite Prompt
This approach is perfectly acceptable for one or two videos, but it becomes difficult to maintain when a project grows.
Several issues appeared quickly:
Camera descriptions were inconsistent. Lighting descriptions changed between authors. Motion instructions were repeated. Negative prompts were forgotten. Style updates required editing every prompt manually.
The biggest problem wasn't generation quality.
It was maintenance.
Treating Prompts as Data
Instead of writing one large paragraph, we divided the prompt into reusable components.
Scene Camera Subject Motion Lighting Style Color Duration Negative Prompt
Each component represents a single responsibility.
This makes prompts easier to edit, reuse, review, and version.
A structured prompt is also easier to generate programmatically.
Creating a Prompt Builder
The following example stores prompt components inside a Python class.
class PromptBuilder: def init(self): self.parts = {}
def add(self, key, value):
self.parts[key] = value
def build(self):
return ", ".join(self.parts.values())
Using the builder is straightforward.
builder = PromptBuilder()
builder.add("scene", "modern office") builder.add("subject", "software engineer") builder.add("camera", "slow tracking shot") builder.add("motion", "natural movement") builder.add("lighting", "soft daylight") builder.add("style", "cinematic") builder.add("negative", "low quality, blurry")
prompt = builder.build()
print(prompt)
Instead of manually rewriting prompts, we now modify only individual fields.
Configuration Outside the Code
Hardcoding prompt values works for prototypes, but configuration files scale much better.
A simple JSON file might look like this:
{ "scene": "modern office", "camera": "tracking shot", "lighting": "soft daylight", "style": "cinematic", "color": "natural", "negative": "blur, watermark" }
Python can load the configuration easily.
import json
with open("prompt.json") as f: config = json.load(f)
builder = PromptBuilder()
for key, value in config.items(): builder.add(key, value)
prompt = builder.build()
Now designers can modify prompt settings without touching application code.
Separating Static and Dynamic Content
Another useful improvement is separating reusable information from scene-specific information.
Static content:
camera language lighting style color grading
Dynamic content:
product location character action narration
The final prompt is created by combining both groups.
This greatly reduces duplicated text.
Versioning Prompt Templates
Prompt engineering often involves experimentation.
Instead of saving multiple text files like:
prompt-final.txt prompt-final-v2.txt prompt-final-last.txt
we stored prompt templates in Git.
Every change became visible.
Every experiment could be reproduced.
Reviewing prompt changes became almost identical to reviewing source code.
Building a Small Pipeline
The workflow eventually became:
Idea ↓ Template ↓ JSON Configuration ↓ Prompt Builder ↓ Generated Prompt ↓ AI Video Model ↓ Review
This architecture proved much easier to maintain.
Updating a camera style required editing only one configuration value.
Small Improvements That Made a Big Difference
Several practices significantly improved consistency.
- Use fixed camera vocabulary
Instead of describing movement differently every time, define a standard list.
Examples:
tracking shot orbit close-up crane shot wide shot
Everyone on the team uses the same terminology.
- Keep lighting independent
Lighting should not be mixed with scene descriptions.
Instead of writing:
A sunny office with warm light...
store:
scene = office lighting = warm sunlight
This makes global changes much easier.
- Maintain reusable negative prompts
Rather than rewriting negative prompts repeatedly, keep one shared template.
For example:
low quality artifacts watermark distortion extra limbs
Every project starts from the same baseline.
Testing the Workflow
To compare both approaches, we generated a collection of short demo videos using identical scene requirements.
The unstructured workflow produced noticeable differences in framing, motion descriptions, and visual consistency because each prompt was written independently.
The structured workflow generated much more consistent outputs across multiple scenes. Camera movement, lighting style, and overall visual language remained stable, while only the scene-specific elements changed.
This also reduced the amount of prompt editing required when new requirements were introduced.
Where Wan 3.0 Fit In
Once the prompt pipeline was stable, we tested it with several AI video models to verify that the structured format remained reusable across different generation systems.
One of the models we evaluated was Wan 3.0. Because the prompts were assembled from reusable components instead of manually written paragraphs, it was easy to reuse the same pipeline for different experiments with only minimal adjustments.
For anyone interested in exploring the model, the official project page is:
The important takeaway, however, is that the pipeline itself remained unchanged. Only the target model varied.
Lessons Learned
Many discussions about AI video generation focus on writing better prompts.
After this project, I found that prompt organization mattered even more.
Treating prompts as structured data instead of plain text brought several benefits:
Easier collaboration. More consistent outputs. Simpler maintenance. Better version control. Faster experimentation. Less duplicated work.
These improvements had little to do with any specific AI model. They came from applying familiar software engineering practices—modularity, configuration management, reusable components, and version control—to prompt design.
As AI-assisted content creation becomes a larger part of development workflows, I think prompt pipelines will gradually resemble traditional software pipelines. The prompt itself is only one piece of the system; the surrounding architecture is what makes the workflow maintainable over time.
All rights reserved