Skip to content

AI short drama & micro-drama video generator — turns any idea into a complete short-form drama using multi-agent AI pipeline (screenwriter → storyboard → frames → video). Seedance 2 VIP, Kling 3.0 Pro, Veo 3.1, Sora 2.

feat: make generative models configurable and add option to skip Seedance

Jaya Prasad Kavuru407db851bb96
diff --git a/server/.env.example b/server/.env.example
index 57ded21..fc4e40a 100644
--- a/server/.env.example
+++ b/server/.env.example
@@ -1 +1,13 @@
MUAPI_KEY=your_api_key_here
+
+# --- Model Selection & Cost Optimisation Options ---
+# Set SKIP_SEEDANCE=True to skip the expensive Seedance video generation model and call Kling directly.
+SKIP_SEEDANCE=False
+
+# Model endpoints on MuAPI. Override these if you want to use cheaper alternative endpoints.
+# For example, to save cost, set KLING_MODEL=kling-v2.1-standard-i2v
+KLING_MODEL=kling-v2.1-master-i2v
+SEEDANCE_MODEL=seedance-2-vip-image-to-video
+PORTRAIT_MODEL=bytedance-seedream-v4.5
+FRAME_MODEL=nano-banana-2-edit
+LLM_MODEL=claude-sonnet-4-6
diff --git a/server/tools/muapi_image_generator.py b/server/tools/muapi_image_generator.py
index 554eecb..7ef99aa 100644
--- a/server/tools/muapi_image_generator.py
+++ b/server/tools/muapi_image_generator.py
@@ -26,10 +26,11 @@ class MuAPIImageGenerator:
lighting. Superior to flux-dev for micro-drama character sheets.
Returns URL of generated image.
"""
+ model = os.environ.get("PORTRAIT_MODEL", "bytedance-seedream-v4.5")
async with httpx.AsyncClient(timeout=60) as client:
try:
resp = await client.post(
- f"{MUAPI_BASE}/bytedance-seedream-v4.5",
+ f"{MUAPI_BASE}/{model}",
headers=self.headers,
json={
"prompt": prompt,
@@ -65,10 +66,11 @@ class MuAPIImageGenerator:
giving strong visual consistency across shots.
Returns URL of generated image.
"""
+ model = os.environ.get("FRAME_MODEL", "nano-banana-2-edit")
async with httpx.AsyncClient(timeout=60) as client:
try:
resp = await client.post(
- f"{MUAPI_BASE}/nano-banana-2-edit",
+ f"{MUAPI_BASE}/{model}",
headers=self.headers,
json={
"prompt": prompt,
diff --git a/server/tools/muapi_llm.py b/server/tools/muapi_llm.py
index 1eb2577..a9f5420 100644
--- a/server/tools/muapi_llm.py
+++ b/server/tools/muapi_llm.py
@@ -32,9 +32,10 @@ class MuAPILLM:
if system_prompt:
payload["system_prompt"] = system_prompt
+ model = os.environ.get("LLM_MODEL", "claude-sonnet-4-6")
async with httpx.AsyncClient(timeout=60) as client:
resp = await client.post(
- f"{MUAPI_BASE}/claude-sonnet-4-6",
+ f"{MUAPI_BASE}/{model}",
headers=self.headers,
json=payload,
)
diff --git a/server/tools/muapi_video_generator.py b/server/tools/muapi_video_generator.py
index 4dc21f1..da2dc8c 100644
--- a/server/tools/muapi_video_generator.py
+++ b/server/tools/muapi_video_generator.py
@@ -38,6 +38,14 @@ class MuAPIVideoGenerator:
# Seedance 2 VIP supports 4-15s; clamp to valid range
sd2_duration = max(4, min(15, duration))
+ skip_seedance = os.environ.get("SKIP_SEEDANCE", "").lower() in ("true", "1", "yes") or \
+ os.environ.get("USE_SEEDANCE", "").lower() in ("false", "0", "no")
+
+ if skip_seedance:
+ print("Skipping Seedance 2 VIP, using Kling directly...")
+ kling_duration = 5 if duration <= 7 else 10
+ return await self._kling_master(prompt, image_url, kling_duration, aspect_ratio)
+
try:
return await self._seedance2_vip(prompt, image_url, sd2_duration, aspect_ratio)
except Exception as e:
@@ -49,10 +57,11 @@ class MuAPIVideoGenerator:
async def _seedance2_vip(
self, prompt: str, image_url: str, duration: int, aspect_ratio: str
) -> str:
+ model = os.environ.get("SEEDANCE_MODEL", "seedance-2-vip-image-to-video")
async with httpx.AsyncClient(timeout=60) as client:
try:
resp = await client.post(
- f"{MUAPI_BASE}/seedance-2-vip-image-to-video",
+ f"{MUAPI_BASE}/{model}",
headers=self.headers,
json={
"prompt": prompt,
@@ -79,10 +88,11 @@ class MuAPIVideoGenerator:
async def _kling_master(
self, prompt: str, image_url: str, duration: int, aspect_ratio: str
) -> str:
+ model = os.environ.get("KLING_MODEL", "kling-v2.1-master-i2v")
async with httpx.AsyncClient(timeout=60) as client:
try:
resp = await client.post(
- f"{MUAPI_BASE}/kling-v2.1-master-i2v",
+ f"{MUAPI_BASE}/{model}",
headers=self.headers,
json={
"prompt": prompt,