
This ComfyUI workflow demonstrates end-to-end text- and image-to-video generation using the OpenAIVideoSora2 node, with optional synchronized audio. You can start from a text prompt alone or condition the video with a reference image loaded via LoadImage. Because Sora-2 and Sora-2 Pro expect fixed input sizes, the workflow offers two branches to make your image fit: Option 1 uses ResizeAndPadImage to letterbox without cropping, and Option 2 crops to fill the frame. PreviewImage lets you confirm framing before you trigger the API call, and SaveVideo writes the returned video to disk.
Technically, the OpenAIVideoSora2 node is the core of the graph, exposing model selection (Sora-2 or Sora-2 Pro), resolution, and prompt fields. The supported sizes are: Sora-2 (720x1280, 1280x720) and Sora-2 Pro (720x1280, 1280x720, 1024x1792, 1792x1024). The workflow groups keep things organized: Upload image, Option1 - Pad image, and Option 2 - Crop image. MarkdownNote and Note nodes include usage and pricing links for the partner API. ImageScale and ResizeAndPadImage align your image to the chosen video size so the API accepts it, while SaveVideo captures the API’s output, including audio when available. This design helps you iterate quickly—preview the conditioned frame, adjust your prompt, then render.
API
Use this workflow from code
Every Comfy workflow is a JSON graph. The payload below is this workflow, exactly as ComfyUI runs it — fetch it from the URL, keep it in version control, or load it in ComfyUI and run it node by node.
GET https://comfy.org/workflows/download/6afbca6e9d22.jsonFetching workflow JSON…
Run it from Python or TypeScript with the Comfy SDK. The same code targets Comfy Cloud or a ComfyUI you host yourself — only the base URL changes.
# Install (beta)
pip install comfy-sdk # Python
npm i @comfyorg/sdk # TypeScript
# Run this workflow (Python)
from comfy_sdk import Comfy
client = Comfy(api_key="comfyui-...")
wf = client.workflows.from_file("workflow_api.json")
job = client.run(wf)
for output in job.get_outputs("<output-node-id>"):
output.to_file(output.name)The SDK takes a workflow in API format: open this workflow in ComfyUI and use File → Export Workflow (API). API access requires a Comfy Cloud plan with an API key. SDK docs · Get an API key
FAQ














