[refactor]: move examples to generate(request) and from_config

Every example calls VideoGenerator.generate with a nested request instead
of generate_video keywords, and passes settings outside the from_pretrained
convenience keywords through VideoGenerator.from_config at their typed
paths. Each request and generator config equals what the keyword call built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012M91wnVFmPEvJ9h39r5BH7
This commit is contained in:
Davids048
2026-10-03 02:14:36 +00:00
co-authored by Claude Opus 5.5
parent 96b7c0d223
commit f571621ae7
66 changed files with 1514 additions and 1130 deletions
+13 -7
View File
@@ -32,13 +32,19 @@ def main():
image_path = "https://pai-aigc-photog.oss-cn-hangzhou.aliyuncs.com/wan_fun/asset_Wan2_2/v1.0/8.png"
control_video_path = "https://pai-aigc-photog.oss-cn-hangzhou.aliyuncs.com/wan_fun/asset_Wan2_2/v1.0/pose.mp4"
video = generator.generate_video(prompt,
negative_prompt=negative_prompt,
image_path=image_path,
video_path=control_video_path,
output_path=OUTPUT_PATH,
output_video_name=OUTPUT_NAME,
save_video=True)
video = generator.generate({
"prompt": prompt,
"negative_prompt": negative_prompt,
"inputs": {
"image_path": image_path,
"video_path": control_video_path,
},
"output": {
"output_path": OUTPUT_PATH,
"output_video_name": OUTPUT_NAME,
"save_video": True,
},
})
if __name__ == "__main__":