01

Define the working folders and completion requirements

Set up a structure with four videos in assets, audio in audio, and outputs in out. Write a production specification covering a width of 1080, height of 1920, a frame rate matching the footage, shot order, caption language, and other requirements.

Keep source assets and use separate file names for drafts and final versions.

02

Save project instructions

In AGENTS.md for Codex or CLAUDE.md for Claude Code, write asset locations, output destinations, production requirements, and verification methods. Both tools can be launched in the project to work on local files.

Specify file names, length, captions, volume, and checks rather than asking only to “make a nice video.”

03

Build a process using FFmpeg

In an environment where FFmpeg can run, ask for a process that matches asset dimensions and frame rates and concatenates them in numbered order. This page's sample is a Python script for creating a visual draft. You can then refine captions and audio in an editor.

Test with short assets first and check output length, dimensions, and playback before processing the full production assets.

04

Review the generated process and finished file

Check inputs, outputs, commands, and length calculations, and evaluate successful execution separately from whether the video is easy to watch. Play the exported video all the way through and check color, composition, captions, and audio boundaries.

Tracking asset lists and configuration files in Git makes it easier to follow language-specific outputs and settings before revisions.

05

Create animated diagrams and text with code

For repeated diagrams and titles with a consistent design, another option is rendering video from React and TypeScript with a tool such as Remotion. Ask Codex or Claude Code to implement scenes and timing, then check the preview.

Check Remotion's official page for usage terms and licenses required for your organization and use.

06

Move on to ComfyUI integration

After building a generation workflow that runs manually, you can also explore Comfy's official MCP to manage workflows from an agent. A local connection uses your ComfyUI and GPU; a cloud connection uses your Comfy account and cloud-side resources.

Check generated workflow correctness and download restrictions, and try the integration with a small task first.

Example request for Codex or Claude Code

Example prompt
Please create a Python script that arranges assets/01_hook.mp4, assets/02_detail.mp4, assets/03_feeling.mp4, and assets/04_ending.mp4 in that order and outputs a 1080×1920, 30 fps visual draft to out/draft.mp4. Use FFmpeg to standardize dimensions and frame rate, and preserve the original assets. Use a different name when an existing finished file is present, and verify dimensions, duration, and playback with short test assets. Narration and captions will be added in the next editing stage.

Production specification to share

video-project/
  AGENTS.md        # Codex project instructions
  CLAUDE.md        # Claude Code project instructions
  shots.json
  assets/
    01_hook.mp4
    02_detail.mp4
    03_feeling.mp4
    04_ending.mp4
  audio/
  out/

Codex

codex
# Scripted task; use permissions appropriate to your project:
codex exec --sandbox workspace-write "Read AGENTS.md and build the video draft."

Claude Code

claude
# Non-interactive task; configured permissions still apply:
claude -p "Read CLAUDE.md and build the video draft."

Comfy MCP

codex mcp add comfy-cloud --url https://cloud.comfy.org/mcp
codex mcp login comfy-cloud

Check the result

  • The input assets and output file names match.
  • The output uses the specified order, dimensions, frame rate, and finished length.
  • The original assets and settings from before revisions are saved.
  • Scripts, captions, and videos for each language are linked to the same article ID and version.

Official guides and references