wf = vs.workflows.create(
name="Barista at dawn",
shots=[{"prompt": "a barista pulling an espresso shot at dawn",
"duration": 6}],
)
# Clip ids are generated; take the first clip of the workflow.
clip_id = next(n["id"] for n in wf["nodes"] if n["type"] == "videoGenerator")
vs.audio.attach_track(
wf["id"], clip_id,
kind="voiceover",
script="Forty seconds. The whole café holds its breath.",
subtitle_style="tiktok",
idempotency_key=f"vo-{wf['id']}",
)
vs.audio.attach_track(
wf["id"], clip_id,
kind="music",
mood="warm low jazz piano",
ducking=True,
volume=0.4,
idempotency_key=f"music-{wf['id']}",
)
vs.audio.set_clip_native_audio(
wf["id"], clip_id,
mode="mix", volume=0.6,
)
video = vs.renders.run(wf["id"], idempotency_key=f"render-{wf['id']}")
print(video.url)