# TongFlow

> Node canvas for chaining text, image, audio, video and 3D generation steps, with a swappable model plugin behind every node

- Category: Multimodal Generation / Video Generation
- Language: TypeScript
- Licence: AGPL-3.0
- Repository: https://github.com/tong-io/tongflow
- Website: https://www.tongflow.com
- Canonical page: https://ai-tldr.dev/tools/tongflow/

## In short

TongFlow is an open-source canvas for building generative AI workflows that cross modalities. It sits in the Video Generation category of the Multimodal Generation tools and is open-source, written in TypeScript and licensed AGPL-3.0. To get started: run it with Docker.

## Overview

TongFlow is an open-source canvas for building generative AI workflows that cross modalities. Text, images, audio, video, 3D models, documents and URLs are the materials; you wire them together as nodes, decide how each one is transformed or combined, then choose the model that runs each step. Every output stays on the canvas as a new material, so a generated image can feed an image-to-video node, a transcript can feed the next text step, and you can branch from any result instead of starting over.

The project calls this approach "modality-first": each step separates three decisions, namely the material you have, the capability you want (understand, generate, transform, combine or split) and the implementation that runs it. Capabilities are defined once in an ABI (a JSON contract of typed input and output slots), and implementations are small Python plugins that bind to those slots with the SDK's `@node_slot` decorator. Several plugins can serve the same slot, so you can swap the model behind one node and keep the rest of the workflow unchanged.

Official plugins cover first-party APIs (OpenAI, Gemini, DeepSeek, ByteDance, xAI, Runway, Qwen-Audio), aggregator routers (OpenRouter, Replicate, fal.ai, CometAPI and others), and open-weight models such as Z-Image, FLUX.2 Klein, Qwen-Image, SAM 3, Whisper, ACE-Step and Docling that run as GPU jobs on Modal. TongFlow runs as a hosted cloud studio (in the browser or a lightweight desktop shell), as a self-hosted Next.js app from source or Docker, or inside an agent: a Claude Code plugin and an MCP server let an agent build `.tongflow.json` workflows that you can open, edit and run again on the canvas. It is dual-licensed under AGPL-3.0 and a commercial licence.

## What it does

- Visual node canvas where every node is a typed capability: add, transform, combine, or split and batch materials across text, image, audio, video, 3D, documents and URLs
- Capability catalogue spanning image generation and editing, text- and image-to-video, lip sync, motion transfer, speech synthesis and voice cloning, music generation, stem separation, image-to-3D and document-to-text
- Plugin ABI that separates what a step does from who runs it, so you can switch the model or provider behind one node without rebuilding the workflow
- Python plugin SDK (`tongflow` on PyPI): handlers are discovered statically from `@node_slot` annotations, with no manifest or registration list
- Self-hosting from source or the GHCR Docker image, with SQLite storage, an in-app plugin manager and a key/value Settings dialog for provider credentials
- Agent integrations: a Claude Code plugin, an MCP server (`tongflow-studio`) and a DeepSeek Harness plugin that create workflows saved next to their outputs

## Getting started

There are three ways in, all on the same open-source core: the hosted TongFlow Cloud (desktop app or app.tongflow.com), a self-hosted install, or TongFlow inside an agent. The steps below cover self-hosting, which is local and account-free; you bring your own provider keys or a Modal token.

1. Run it with Docker

   A self-host image is published to GHCR, so no Node, Python or pnpm setup is needed. Everything writable (SQLite database, uploads, settings) lives in the /data volume. Then open http://localhost:3000.

```bash
docker run -d -p 3000:3000 \
  -v tongflow-data:/data -v tongflow-plugins:/plugins \
  ghcr.io/tong-io/tongflow:latest
```

2. Or run it from source

   Running from source requires Node with pnpm and Python 3.10+ on your PATH. Plugins run as local Python processes, and TongFlow provisions an isolated venv and installs each plugin's requirements on first use.

```bash
pnpm install
pnpm plugins:install   # clone official plugins into plugins/
pnpm start:prod        # builds once, then serves at http://localhost:3000
```

3. Install plugins and add credentials

   A self-hosted instance ships with no plugins. Open the plugin manager (the blocks icon, top-right) and install what you need. To run the preloaded example workflow (text → image → fusion → video), install tongflow-modal-z-image, tongflow-modal-qwen-image-edit and tongflow-modal-minimax-h3, then add MODAL_TOKEN_ID and MODAL_TOKEN_SECRET in Settings (the gear icon). API plugins take keys such as OPENAI_API_KEY or OPENROUTER_API_KEY the same way.

4. Run the workflow

   Run the example node by node, or switch to Execute Mode and press the run button to run the whole graph in one go. Swap the implementation on any node to try a different model for that step.

5. Or drive it from an agent

   In Claude Code, add the marketplace and install the plugin, then ask for what you want to make. Any MCP client can use the same tools through the tongflow-studio server.

```text
/plugin marketplace add tong-io/tongflow
/plugin install tongflow@tongflow

# any MCP client
{ "mcpServers": { "tongflow": { "command": "npx", "args": ["-y", "tongflow-studio", "mcp"] } } }
```

## When to use it

- Building a talking-head avatar: write a script, synthesise speech, generate a character image, then lip-sync them into a video
- Producing a music video by chaining generated lyrics and song with character, scene and storyboard images and clip generation
- Comparing image, video or speech models on the same pipeline by swapping only the plugin behind one node
- Letting a coding agent plan a media project while every generated asset stays reproducible as an editable workflow file
