This ComfyUI workflow converts vertical videos to horizontal (and vice versa) by outpainting new canvas areas while keeping the original content intact. It uses LoadVideo and GetVideoComponents to pull frames, FPS, and audio, then normalizes frame size with JWImageResizeByShorterSide so the shorter side matches your target resolution. A masking stage—powered by masquerade-nodes-comfyui and a custom utility node (UUID: 7594b5c0-2b90-4aeb-846b-e3eb8fa89f33)—defines where to synthesize new content versus where to preserve the source. The core transformation happens in KlingOmniProEditVideoNode running the Kling O3 model, which content-aware outpaints the added side bands to reach your target aspect. Video Slice lets you process in manageable chunks for stability and VRAM efficiency, and CreateVideo + SaveVideo assemble and write the final file, with optional audio passthrough from GetVideoComponents.

What makes this useful is that you don’t have to crop away important action. Instead, you reframe with horizontal/vertical offsets and extend the scene, maintaining motion continuity and subject integrity. The workflow is organized into groups—Input Video, Video Resize and Extend, and Video Outpaint—and includes an application mode for a simplified UI: set the target aspect, tweak offsets, and run. Note: this pipeline is optimized for 9:16 ↔ 16:9 conversions. For minor aspect changes or square (1:1), the Kling video edit node isn’t recommended; consider basic crop/pad instead.

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/2a95da601676.json
Fetching 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

Frequently Asked Questions

View all workflows
Character
Cinematic
Image to Video
Lip Sync
Multiple Angles
Portrait
Style Reference
Style Transfer
Text to Video
Video Generation
Video
Showing 30 of 30 templates