Skip to content

anbeime/skill / skills/agentkit-multimedia-shopping/agentkit-multimedia-shopping

agentkit-multimedia-shopping

Verified

电商运营与内容创作者在需要制作带货短视频时,用此技能一键生成9:16竖屏数字人成片。自动编排AI绘画、语音合成与视频生成,快速产出“小省导购员”专属形象与专业配音,让多模态视频制作省时省力。

scripts/generate_scene.py

View on GitHub
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
场景背景生成脚本
基于ByteDance agentkit-samples多媒体用例
"""

import sys
import os

def generate_scene(prompt, aspect_ratio="9:16", resolution="1080x1920"):
    """
    生成场景背景

    Args:
        prompt (str): 场景背景提示词
        aspect_ratio (str): 画面比例,默认"9:16"
        resolution (str): 分辨率,默认"1080x1920"

    Returns:
        object: 场景背景对象(根据实际工具返回)

    Raises:
        ValueError: 参数验证失败
        Exception: 生成失败
    """
    # 参数验证
    if not prompt:
        raise ValueError("提示词不能为空")

    if aspect_ratio != "9:16":
        raise ValueError("画面比例必须为9:16")

    if resolution != "1080x1920":
        raise ValueError("分辨率必须为1080x1920")

    # TODO: 调用实际的AI绘画工具
    # 这里需要根据ByteDance agentkit-samples的实际实现来调用
    # 示例代码(伪代码):
    #
    # from agentkit import ImageGenerator
    #
    # generator = ImageGenerator()
    # image = generator.generate(
    #     prompt=prompt,
    #     aspect_ratio=aspect_ratio,
    #     resolution=resolution
    # )
    #
    # return image

    # 占位符返回
    print(f"[generate_scene] 生成场景背景")
    print(f"  提示词: {prompt[:50]}...")
    print(f"  画面比例: {aspect_ratio}")
    print(f"  分辨率: {resolution}")

    return None


def main():
    """
    主函数:从命令行读取参数并生成场景背景
    """
    import argparse

    parser = argparse.ArgumentParser(description="生成场景背景")
    parser.add_argument("--prompt", type=str, required=True, help="场景背景提示词")
    parser.add_argument("--aspect-ratio", type=str, default="9:16", help="画面比例")
    parser.add_argument("--resolution", type=str, default="1080x1920", help="分辨率")
    parser.add_argument("--output", type=str, default="./output/scene_reference.jpg", help="输出文件路径")

    args = parser.parse_args()

    try:
        # 生成场景背景
        scene_image = generate_scene(
            prompt=args.prompt,
            aspect_ratio=args.aspect_ratio,
            resolution=args.resolution
        )

        # 保存场景背景
        if scene_image:
            # 确保输出目录存在
            output_dir = os.path.dirname(args.output)
            if output_dir and not os.path.exists(output_dir):
                os.makedirs(output_dir)

            scene_image.save(args.output)
            print(f"场景背景已保存至: {args.output}")
        else:
            print("警告: 场景背景生成返回为空(可能是占位符)")

        return 0

    except ValueError as e:
        print(f"参数错误: {e}", file=sys.stderr)
        return 1
    except Exception as e:
        print(f"生成失败: {e}", file=sys.stderr)
        return 2


if __name__ == "__main__":
    sys.exit(main())
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall