anbeime/skill / skills/video-recreation/video-recreation
video-recreation
Unverified自媒体创作者与影片与视频编辑在需要视频二创或反推参考视频时,一键完成从AI视觉分析、图文音素材生成到最终合成的全流程,自动产出包含配音与字幕的高质量二创视频,让创作效率翻倍!
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.4 KB |
| references/prompt-templates.md | markdown | 6.1 KB |
| references/recreation-guide.md | markdown | 8.8 KB |
| references/suno-api-guide.md | markdown | 8.6 KB |
| scripts/audio_generator.py | script | 4.9 KB |
| scripts/coze_bot_client.py | script | 10.4 KB |
| scripts/error_handler.py | script | 9.8 KB |
| scripts/file_server.py | script | 6.3 KB |
| scripts/image_generator.py | script | 3.0 KB |
| scripts/sound_generator.py | script | 17.1 KB |
| scripts/subtitle_generator.py | script | 7.5 KB |
| scripts/video_compositor.py | script | 7.9 KB |
| scripts/video_frame_extractor.py | script | 6.4 KB |
| scripts/voice_generator.py | script | 7.8 KB |
scripts/image_generator.py
View on GitHub#!/usr/bin/env python3
"""
图像生成脚本
为视频创作生成关键帧图片和背景图像
"""
import os
from typing import Dict, Any
from .error_handler import retry_on_failure, ErrorLogger, safe_execute
logger = ErrorLogger()
@retry_on_failure(max_retries=2, retry_delay=0.5)
def generate_image_from_prompt(
prompt: str,
output_path: str,
image_size: str = "1024x1024",
style: str = "realistic",
seed: int = None
) -> Dict[str, Any]:
"""
根据提示词生成图像(占位实现)
参数:
prompt: 图像生成提示词
output_path: 输出图像路径
image_size: 图像尺寸(1024x1024, 768x1344, 832x1216等)
style: 图像风格(realistic, cartoon, artistic等)
seed: 随机种子(可选)
返回:
包含生成结果的字典
"""
# 验证输出目录
os.makedirs(os.path.dirname(output_path), exist_ok=True)
# 占位实现 - 实际应调用图像生成API
# 这里创建一个纯色占位图
from PIL import Image, ImageDraw
width, height = map(int, image_size.split('x'))
image = Image.new('RGB', (width, height), color='lightgray')
draw = ImageDraw.Draw(image)
# 添加提示词文本
draw.text((10, 10), prompt[:100], fill='black')
image.save(output_path)
logger.log_info(f"图像已生成(占位): {output_path}")
return {
"success": True,
"output_path": output_path,
"prompt": prompt,
"image_size": image_size,
"style": style
}
def batch_generate_images(
prompts: list,
output_dir: str,
naming_pattern: str = "frame_{:04d}.png"
) -> list:
"""
批量生成图像
参数:
prompts: 提示词列表
output_dir: 输出目录
naming_pattern: 文件命名模式
返回:
生成结果列表
"""
os.makedirs(output_dir, exist_ok=True)
results = []
for i, prompt in enumerate(prompts):
output_path = os.path.join(output_dir, naming_pattern.format(i))
result = generate_image_from_prompt(
prompt=prompt,
output_path=output_path
)
results.append(result)
logger.log_info(f"进度: {i+1}/{len(prompts)}")
return results
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description="图像生成工具")
parser.add_argument("--prompt", required=True, help="图像生成提示词")
parser.add_argument("--output", required=True, help="输出图像路径")
parser.add_argument("--size", default="1024x1024", help="图像尺寸")
parser.add_argument("--style", default="realistic", help="图像风格")
args = parser.parse_args()
result = generate_image_from_prompt(
prompt=args.prompt,
output_path=args.output,
image_size=args.size,
style=args.style
)
if result["success"]:
print(f"✓ 图像生成成功: {result['output_path']}")
else:
print(f"✗ 图像生成失败")
exit(1)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |