短剧是 2026 年最火的内容形态之一。从抖音到快手,从微信视频号到小红书,竖屏短剧正在吞噬用户的碎片时间。AI 技术的成熟让"一个人拍一部短剧"成为可能。本文将完整拆解 AI 短剧从剧本到成片的全流程。
一、短剧市场与 AI 机会 市场规模 维度 数据 2026 中国短剧市场规模 ¥500 亿+ 日均新剧上线 500+ 部 单集平均时长 1-3 分钟 典型部集数 20-80 集 传统制作成本 ¥3-10 万/部 AI 制作成本 ¥500-3000/部 短剧类型与 AI 适配度 类型 AI 适配度 原因 霸总/豪门 ⭐⭐⭐⭐⭐ 场景固定,人物少 穿越/重生 ⭐⭐⭐⭐ 创意空间大,特效需求 AI 能满足 古装/宫斗 ⭐⭐⭐ 服饰场景复杂,AI 需要多次迭代 悬疑/推理 ⭐⭐⭐ 需要精确的细节线索 动作/武打 ⭐⭐ 动作复杂度高,AI 生成仍有局限 都市情感 ⭐⭐⭐⭐⭐ 现代场景 AI 生成质量高 二、全流程概览 阶段一:剧本创作(1-2小时) ├── 选题策划 → GPT-4o 生成故事大纲 ├── 剧本撰写 → 逐集脚本生成 ├── 对白优化 → 口语化 + 情感强化 └── 分镜设计 → 每集 8-15 个镜头 阶段二:视觉设计(1-2小时) ├── 角色设计 → Midjourney 生成角色定妆照 ├── 场景设计 → 生成主要场景图 ├── 道具设计 → 关键道具图 └── 风格定义 → 全剧视觉统一 阶段三:视频生成(3-6小时) ├── 逐镜头生成 → 可灵 3.0 / Sora 2 ├── 角色一致性 → 参考图引导 ├── 场景过渡 → 转场设计 └── 质量筛选 → 多变体选优 阶段四:后期制作(2-3小时) ├── 对白配音 → CosyVoice 角色配音 ├── BGM 制作 → Suno / MusicGen ├── 音效添加 → AI 音效生成 ├── 字幕生成 → Whisper 3 └── 最终合成 → 剪辑 + 调色 + 输出 总耗时:8-12 小时(对比传统 2-4 周) 三、阶段一:剧本创作 故事大纲生成 class ScriptGenerator: """AI 短剧剧本生成器""" def __init__(self): self.llm = OpenAI() async def generate_series(self, config): """生成完整短剧剧本""" # 1. 生成故事大纲 outline = await self._generate_outline(config) # 2. 逐集生成剧本 episodes = [] for ep_num in range(1, config["total_episodes"] + 1): episode = await self._generate_episode( outline, ep_num, config ) episodes.append(episode) return { "title": outline["title"], "logline": outline["logline"], "characters": outline["characters"], "episodes": episodes } async def _generate_outline(self, config): """生成故事大纲""" prompt = f""" 请创作一部竖屏短剧的故事大纲。 类型:{config['genre']} 集数:{config['total_episodes']} 每集时长:{config['episode_duration']}秒 目标受众:{config['target_audience']} 核心设定:{config['premise']} 要求: 1. 前3集必须有强钩子(hook) 2. 每3-5集一个反转 3. 最后一集高潮+开放式结局 4. 主要角色3-5个 5. 场景不超过8个(控制制作成本) 返回JSON格式: {{ "title": "剧名", "logline": "一句话简介", "characters": [ {{"name": "", "age": 0, "personality": "", "appearance": "", "voice_type": ""}} ], "locations": ["场景1", "场景2"], "story_arc": "整体故事线", "episode_summaries": ["第1集摘要", "第2集摘要"] }} """ response = await self.llm.chat.completions.acreate( model="gpt-4o", messages=[{"role": "user", "content": prompt}], response_format={"type": "json_object"}, temperature=0.8 ) return json.loads(response.choices[0].message.content) 逐集脚本生成 async def _generate_episode(self, outline, ep_num, config): """生成单集详细脚本""" prompt = f""" 短剧《{outline['title']}》第 {ep_num} 集 故事大纲:{outline['story_arc']} 本集摘要:{outline['episode_summaries'][ep_num-1]} 角色:{json.dumps(outline['characters'], ensure_ascii=False)} 请生成本集详细脚本,格式如下: {{ "episode": {ep_num}, "title": "本集标题", "duration": {config['episode_duration']}, "scenes": [ {{ "scene_number": 1, "location": "场景", "characters": ["出场角色"], "shots": [ {{ "shot_type": "特写/中景/全景", "description": "画面描述(用于AI视频生成)", "dialogue": "角色对白", "action": "角色动作", "emotion": "情感", "duration": 5 }} ] }} ], "ending_hook": "本集结尾钩子" }} 要求: - 每集 8-15 个镜头 - 对白简洁有力(每句不超过20字) - 画面描述详细(用于AI视频生成的prompt) - 每3个镜头至少一个情绪转折 """ response = await self.llm.chat.completions.acreate( model="gpt-4o", messages=[{"role": "user", "content": prompt}], response_format={"type": "json_object"}, temperature=0.7 ) return json.loads(response.choices[0].message.content) 四、阶段二:视觉设计 角色一致性管理 class CharacterDesigner: """角色设计器""" def __init__(self): self.mj_client = MidjourneyClient() async def design_characters(self, characters_config): """为所有角色生成定妆照""" character_images = {} for char in characters_config: # 生成角色定妆照 prompt = f""" Character portrait of {char['name']}, {char['age']} years old, {char['appearance']}, professional headshot, consistent lighting, neutral background, 8K, photorealistic --ar 2:3 --style raw --v 7 """ # 生成多个角度 images = { "front": await self.mj_client.generate(prompt + " front view"), "side": await self.mj_client.generate(prompt + " side profile"), "three_quarter": await self.mj_client.generate(prompt + " three-quarter view") } character_images[char["name"]] = images return character_images def build_reference_prompt(self, character_name, character_images, scene_description): """构建带角色参考的 prompt""" return { "prompt": scene_description, "reference_images": character_images[character_name], "character_name": character_name } 场景设计 class SceneDesigner: """场景设计器""" async def design_scenes(self, locations, style="cinematic"): """设计所有场景""" scene_images = {} for location in locations: prompt = f""" {location}, {style} style, establishing shot, 8K, professional lighting, detailed --ar 9:16 --v 7 """ # 生成日景和夜景 scene_images[location] = { "day": await self.mj_client.generate(prompt + " daytime"), "night": await self.mj_client.generate(prompt + " night") } return scene_images 五、阶段三:视频生成 逐镜头生成 class VideoGenerator: """逐镜头视频生成""" def __init__(self): self.kling = KlingAPI() # 可灵 3.0 self.sora = SoraAPI() # Sora 2 async def generate_episode(self, episode, character_images, scene_images): """生成一集的所有镜头""" video_clips = [] for scene in episode["scenes"]: for shot in scene["shots"]: # 构建生成 prompt prompt = self._build_shot_prompt( shot, scene, character_images, scene_images ) # 选择生成引擎 if shot["shot_type"] == "特写": # 特写用 Sora 2(细节更好) clip = await self.sora.generate( prompt=prompt["text"], reference_images=prompt["references"], duration=shot["duration"], aspect_ratio="9:16" ) else: # 其他用可灵 3.0(中文场景好) clip = await self.kling.generate( prompt=prompt["text"], reference_images=prompt["references"], duration=shot["duration"], aspect_ratio="9:16" ) video_clips.append({ "scene": scene["scene_number"], "shot": shot, "video": clip, "dialogue": shot.get("dialogue", "") }) return video_clips def _build_shot_prompt(self, shot, scene, char_imgs, scene_imgs): """构建镜头生成 prompt""" # 获取场景参考图 scene_ref = scene_imgs.get(scene["location"], {}).get("day") # 获取角色参考图 char_refs = [] for char_name in scene["characters"]: if char_name in char_imgs: char_refs.append(char_imgs[char_name]["front"]) # 构建 prompt prompt_text = ( f"{shot['description']}, " f"{shot['shot_type']}, " f"{shot.get('emotion', 'neutral')} mood, " f"cinematic, 9:16 vertical" ) return { "text": prompt_text, "references": [scene_ref] + char_refs } 角色一致性优化 class ConsistencyManager: """角色一致性管理""" async def generate_with_consistency(self, prompt, char_refs, max_retries=5): """生成视频并验证角色一致性""" for attempt in range(max_retries): # 生成视频 video = await self.kling.generate( prompt=prompt, reference_images=char_refs, seed=self._get_seed(attempt) ) # 验证角色一致性 consistency_score = await self._verify_consistency( video, char_refs ) if consistency_score > 0.85: return video # 返回最佳结果 return video async def _verify_consistency(self, video, reference_images): """使用 GPT-4o 验证角色一致性""" # 抽取视频关键帧 key_frames = self._extract_frames(video, n=5) scores = [] for frame in key_frames: # 对比角色参考图 result = await self.gpt4o.compare( image_a=frame, image_b=reference_images[0], question="这是同一个人吗?相似度0-100" ) scores.append(result.score / 100) return np.mean(scores) 六、阶段四:后期制作 对白配音 class VoiceDirector: """AI 配音导演""" def __init__(self): self.tts = CosyVoice2("pretrained_model") async def dub_episode(self, video_clips, characters_config): """为整集配音""" # 为每个角色克隆声音 voice_ids = {} for char in characters_config: # 使用 3 秒样本克隆角色声音 voice_ids[char["name"]] = self.tts.clone_voice( audio=f"voice_samples/{char['name']}.wav" ) # 逐镜头配音 for clip in video_clips: if clip["dialogue"]: # 判断说话角色 speaker = self._detect_speaker(clip["dialogue"]) # 生成配音 audio = self.tts.synthesize( text=clip["dialogue"], voice_id=voice_ids[speaker], emotion=clip["shot"].get("emotion", "neutral") ) clip["audio"] = audio return video_clips 最终合成 class FinalComposer: """最终合成""" async def compose_episode(self, video_clips, bgm_path, subtitles, output_path): """合成最终视频""" # 1. 拼接所有镜头 video_track = concatenate_videoclips( [clip["video"] for clip in video_clips] ) # 2. 拼接所有音频 audio_track = concatenate_audioclips( [clip.get("audio", silent) for clip in video_clips] ) # 3. 添加 BGM bgm = AudioFileClip(bgm_path).volumex(0.15) final_audio = CompositeAudioClip([audio_track, bgm]) # 4. 合并音视频 final = video_track.set_audio(final_audio) # 5. 添加字幕 final = self._add_subtitles(final, subtitles) # 6. 调色 final = self._color_grade(final, style="drama") # 7. 导出 final.write_videofile( output_path, fps=30, codec="libx264", audio_codec="aac", bitrate="4000k" ) 七、成本分析 单集成本(2分钟/集) 环节 成本 剧本生成 ¥0.5 角色设计(分摊) ¥1.0 视频生成 ¥5-15 配音 ¥0.5 BGM ¥0 后期合成 ¥0 总计 ¥7-17 整部短剧成本(30集) 方案 成本 耗时 AI 全自动 ¥210-510 8-12 小时 AI + 人工审核 ¥500-1000 2-3 天 传统制作 ¥30,000-100,000 2-4 周 八、质量优化建议 剧本层面 前 3 秒必须有强 hook(冲突/悬念/反转) 每集结尾留悬念 对白不超过 20 字/句 避免超过 3 人同时出场的镜头 视觉层面 固定角色种子,确保跨集一致 避免复杂动作(打斗/奔跑) 多用特写和近景(AI 生成质量更高) 统一色调风格 音频层面 为每个角色使用独立的声音 BGM 不要太抢旁白 关键台词语速放慢 九、平台适配 平台 时长 比例 发布策略 抖音 1-3min 9:16 每天更1-2集 快手 1-3min 9:16 每天更1-2集 微信视频号 1-3min 9:16 每天更1集 小红书 1-3min 9:16 每周更3-5集 B站 3-10min 16:9 合并为长版 结语 AI 短剧生成在 2026 年已经实现了从"不可能"到"可量产"的跨越。¥210-510 即可制作一部 30 集短剧,成本仅为传统制作的 1/100。但低成本不意味着低质量——好的故事、强的人物和精准的节奏才是短剧成功的关键。AI 解决了"制作"问题,“创意"仍然是人类的专属领域。
...