# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"767": {
"class_type": "ByteDance2TextToVideoNode",
"inputs": {
"model": "Seedance 2.5 Draft",
"model.duration": 5,
"model.generate_audio": True,
"model.output_format": "mp4",
"model.prompt": "**Cinematic rocket launch sequence, 5 seconds, IMAX blockbuster style, hard cuts between wide, medium, and close shots.**\n\n**Shot 1 (0–1.2s) – Extreme Wide Establishing:** Blue-hour dawn at a coastal launch site. A towering white rocket stands on the pad beside its steel gantry, lit by sharp xenon floodlights. Cryogenic vapor drifts from its frosted fuselage, and a faint amber glow sits on the horizon. The camera makes a slow, steady push-in with a symmetrical, monumental composition.\n\n**Shot 2 (1.2–2.4s) – Extreme Close-Up Ignition:** Hard cut to the engine nozzles. The engines ignite in a violent burst of white-hot and orange flame, showing visible shock diamonds and heat-distortion shimmer. The water deluge flashes into massive billowing steam clouds. Sparks and debris scatter, and the camera trembles with a subtle, realistic shake.\n\n**Shot 3 (2.4–3.7s) – Low-Angle Medium Liftoff:** Hard cut to a ground-level low angle. The rocket slowly clears the tower as the umbilical arms swing away. The camera tilts upward, following the ascent, while roaring flames light up the steel structure and rolling clouds of steam surge toward the lens.\n\n**Shot 4 (3.7–5s) – Telephoto Ultra-Wide Ascent:** Hard cut to a long-lens tracking shot from miles away. The rocket arcs gracefully into the sky on a brilliant pillar of fire, leaving a glowing golden exhaust plume. It pierces a thin layer of clouds as the first rays of sunrise catch the contrail. The sequence ends on an epic, awe-inspiring silhouette against the gradient sky.\n\n**Style:** Photorealistic, shot on ARRI Alexa 65 with anamorphic lenses. The look is Christopher Nolan / Interstellar-grade realism, featuring teal-and-amber color grading, high dynamic range, and volumetric light and haze. Details include cinematic lens flares, subtle film grain, shallow depth of field in the close-ups, and slow-motion accents on the ignition. The mood is majestic, precise, and emotionally powerful, with ultra-detailed textures, 4K resolution, and smooth, stable camera movement.",
"model.ratio": "adaptive",
"model.resolution": "480p",
"seed": 2109791818,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 Text to Video"
}
},
"771": {
"class_type": "SaveText",
"inputs": {
"filename_prefix": "Seedance2.5_draft_task_id_%year%_%month%_%day%",
"format": "txt",
"text": [
"767",
1
]
},
"_meta": {
"title": "Save Text"
}
},
"776": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "video/Seedance2.5_draft",
"format": "auto",
"format.codec": "auto",
"video": [
"767",
0
]
},
"_meta": {
"title": "Save Video"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)
for output in job.get_outputs("776"):
output.to_file(output.name)