A next-generation AI-powered infinite canvas workspace built for creators and developers. Experience the future of Generative AI with a drag-and-drop node interface that combines Google Gemini 3 Pro, Veo 3.1, and LangGraph Agents into a seamless creative workflow.
273
stars
181
commits
TypeScript
primary language
Jul 9, 2026
updated
A modern, AI-powered canvas application for generating and manipulating images and videos using OpenAI GPT Image, Google Gemini, Kling AI, Hailuo AI (MiniMax), and Fal.ai. Built with React, TypeScript, and Vite.
https://github.com/user-attachments/assets/7a64d4df-7ade-4bfa-b2cd-d615d267dd40
Transfer motion from a reference video to a character image - make anyone dance!
https://github.com/user-attachments/assets/1ee6cbf3-00a5-496e-852c-3304c6ebc6c9
Download all the generated videos and use video editting tool like CapCut to create a final video. Check result below.
https://github.com/user-attachments/assets/43cf8bb8-bf85-45f9-96da-657033126d94
https://github.com/user-attachments/assets/e6f89da5-d3a6-4889-a38b-672cf37bbd79
Transform any image by adjusting camera rotation and tilt angles.
https://github.com/user-attachments/assets/f0d678df-31ac-4431-bd7c-eea3950bfb1d
Create video storyboards with consistent characters and layouts.
https://github.com/user-attachments/assets/3c36de54-d37e-4875-8403-5b6e4a6216e0
Clone the repository
git clone https://github.com/SankaiAI/TwitCanva.git
cd TwitCanva
Install dependencies
npm install
Set up environment variables
Create a .env file in the root directory:
# Get from https://aistudio.google.com/app/apikey
GEMINI_API_KEY=your_gemini_api_key_here
# Get from https://app.klingai.com/global/dev/api-key
KLING_ACCESS_KEY=your_kling_access_key_here
KLING_SECRET_KEY=your_kling_secret_key_here
# Get from https://platform.minimax.io/user-center/basic-information/interface-key
HAILUO_API_KEY=your_hailuo_api_key_here
# Get from https://platform.openai.com/api-keys
OPENAI_API_KEY=your_openai_api_key_here
# Get from https://fal.ai/dashboard/keys (for Kling V2.6 Motion Control)
FAL_API_KEY=your_fal_api_key_here
# Optional: X (Twitter) Post Feature - Get from https://developer.twitter.com/en/portal
# See docs/post-to-x.md for detailed setup instructions
TWITTER_CLIENT_ID=your_twitter_client_id
TWITTER_CLIENT_SECRET=your_twitter_client_secret
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_twitter_access_token_secret
TWITTER_CALLBACK_URL=http://127.0.0.1:3001/api/twitter/callback
# Optional: TikTok Post Feature - Get from https://developers.tiktok.com/
# See docs/tiktok-integration.md for detailed setup instructions
TIKTOK_CLIENT_KEY=your_tiktok_client_key
TIKTOK_CLIENT_SECRET=your_tiktok_client_secret
TIKTOK_CALLBACK_URL=https://your-ngrok-url.ngrok-free.app/api/tiktok-post/callback
โ ๏ธ Security: API keys are stored server-side only and never exposed to the client.
Start the development server
npm run dev
This starts both:
http://localhost:5173http://localhost:3001If you prefer using Docker to run the application in a containerized environment (recommended for deployment):
Clone the repository and set up .env (same as steps 1-3 above)
Run with Docker Compose
docker compose up -d --build
http://localhost:3001library/ folderdocker compose downTwitCanva supports running open-source AI models (like Stable Diffusion, Qwen Camera Control, ControlNet) locally on your GPU. This is optional - the cloud-based AI models work without this setup.
Requirements:
Setup:
# Option 1: Use npm script (recommended)
npm run setup:local-models
# Option 2: Run setup script directly
# Windows:
setup-local-models.bat
# Linux/macOS:
chmod +x setup-local-models.sh
./setup-local-models.sh
This will:
venv/)models/ directory structureAdding Models:
Download models from HuggingFace, Civitai, or similar sites (.safetensors, .ckpt, or .pt files) and place them in the appropriate folder:
| Folder | Model Types | Examples |
|---|---|---|
models/checkpoints/ | Main image generation models | Stable Diffusion 1.5, SDXL, DreamShaper, Juggernaut XL, Flux |
models/loras/ | LoRA adapters for styles/characters | Art styles, character LoRAs, detail enhancers |
models/controlnet/ | Guided generation models | OpenPose, Canny, Depth, Tile |
models/video/ | Video generation models | AnimateDiff, Stable Video Diffusion (SVD) |
Using Local Models:
๐ For detailed documentation, see docs/local-model-support.md
Transform your generated images with AI-powered camera angle manipulation using the Qwen Image Edit model.
For users without high-end GPUs, we provide a Modal-based cloud deployment.
Install Modal:
pip install modal
modal setup
Deploy the App:
modal deploy modal/camera_angle.py
Configure Environment:
Copy the generated generate endpoint URL and add it to your .env file:
VITE_MODAL_CAMERA_ENDPOINT=https://your-workspace--camera-angle-control-cameraangle-generate.modal.run
Managing Costs:
modal app stop camera-angle-control to disable the endpoint entirely.modal deploy modal/camera_angle.py again to re-enable.Tip: Stop the app when not actively using the feature to avoid any accidental charges.
This feature requires a 24GB VRAM GPU (RTX 3090/4090).
Download Models (~35GB):
# Activate venv
.\venv\Scripts\activate # Windows
source venv/bin/activate # Linux/macOS
# Download fast transformer (~20GB)
huggingface-cli download linoyts/Qwen-Image-Edit-Rapid-AIO \
--local-dir models/camera-control/qwen-rapid-aio \
--include "transformer/*"
# Download camera angle LoRA (~236MB)
huggingface-cli download dx8152/Qwen-Edit-2509-Multiple-angles \
้ๅคด่ฝฌๆข.safetensors \
--local-dir models/camera-control/loras
Configure HuggingFace Cache (Recommended):
By default, HuggingFace caches models to your C: drive. Move the cache to prevent filling up your system drive:
# Windows - Set cache to D: drive
[System.Environment]::SetEnvironmentVariable("HF_HOME", "D:\HuggingFace_Cache", "User")
# Restart terminal after running
# Linux/macOS - Add to ~/.bashrc or ~/.zshrc
export HF_HOME="/path/to/your/cache"
source ~/.bashrc
Start Camera Angle Server:
.\start-camera-server.bat # Windows
./start-camera-server.sh # Linux/macOS
# Server runs on http://localhost:8100
๐ For detailed documentation, see docs/camera-angle-control.md
All generated assets are automatically saved to local folders. These folders are created automatically when the server starts if they don't exist.
| Asset Type | Folder | File Format | Notes |
|---|---|---|---|
| Images | library/images/ | .png + .json | Auto-saved on generation |
| Videos | library/videos/ | .mp4 + .json | Auto-saved on generation |
| Workflows | library/workflows/ | .json | Manual save via UI |
| Chat Sessions | library/chats/ | .json | Auto-saved per message |
| Assets | library/assets/ | Various | User uploaded files |
fs.mkdirSync(dir, { recursive: true })/library/* URLs.json file with prompt, timestamp, and other infoNote: The
library/folder is in.gitignoreand won't be committed to the repository.
Ctrl/Cmd + Mouse Wheel or use the zoom sliderShift + Click or drag a selection boxAccess import tools via the Wrench icon in the left toolbar.
Download TikTok videos without watermark to use as motion references for the Motion Control feature:
Tip: The imported video will appear in your Video History and can be used as a motion reference when generating videos with Kling V2.6 Motion Control. This allows you to transfer dance moves, gestures, or any motion from TikTok videos to your AI-generated characters!
Note: First and last frames are automatically trimmed to remove TikTok watermarks (requires ffmpeg installed on your system).
Share your generated images and videos directly to Twitter/X:
Rate Limits (Free Tier): 17 posts/day, 85 media uploads/day. See Post to X Documentation for setup instructions.
Share your generated videos directly to TikTok:
Note: Unaudited apps can only post to private accounts. See TikTok Integration Documentation for full setup.
npm run dev # Start frontend + backend together
npm run server # Start backend server only (port 3001)
npm run build # Build for production
npm run preview # Preview production build
Your API key is never exposed to the browser:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Browser/Client โโโโโโถโ Backend :3001 โโโโโโถโ Gemini API โ
โ (No API key) โ โ (.env file) โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
.env (server-side only).env file is in .gitignoreImage Generation:
| Model | Provider | Image-to-Image | Multi-Image |
|---|---|---|---|
| GPT Image 1.5 | OpenAI | โ | โ |
| Gemini Pro | โ | โ | |
| Kling V1 | Kling AI | โ | โ |
| Kling V1.5 | Kling AI | โ | โ |
| Kling V2 New | Kling AI | โ | โ |
| Kling V2.1 | Kling AI | โ | โ |
Video Generation:
| Model | Provider | Text-to-Video | Image-to-Video | Frame-to-Frame |
|---|---|---|---|---|
| Veo 3.1 | โ | โ | โ | |
| Kling V1 | Kling AI | โ | โ | โ |
| Kling V1.5 | Kling AI | โ | โ | โ |
| Kling V1.6 | Kling AI | โ | โ | โ |
| Kling V2 Master | Kling AI | โ | โ | โ |
| Kling V2.1 | Kling AI | โ | โ | โ |
| Kling V2.1 Master | Kling AI | โ | โ | โ |
| Kling V2.5 Turbo | Kling AI | โ | โ | โ |
| Hailuo 2.3 | MiniMax | โ | โ | โ |
| Hailuo 2.3 Fast | MiniMax | โ | โ | โ |
| Hailuo 02 | MiniMax | โ | โ | โ |
| Hailuo O2 | MiniMax | โ | โ | โ |
| Kling V2.6 Motion | Fal.ai | โ | โ | Motion Control |
Chat:
See code-style-guide.md for detailed guidelines:
anysrc/components/src/hooks/server/index.jssrc/types.tsContributions are welcome! Please:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the Apache License 2.0.
If you are using this project for commercial purposes or building a commercial product, please refer to the NOTICE file for notification requirements.
Built with โค๏ธ using React, TypeScript, and AI APIs from OpenAI, Google, Kling, MiniMax, and Fal.ai (2025)
181 commits
TypeScript
72.6%
JavaScript
23.4%
Python
3.3%
A next-generation AI-powered infinite canvas workspace built for creators and developers. Experience the future of Generative AI with a drag-and-drop node interface that combines Google Gemini 3 Pro, Veo 3.1, and LangGraph Agents into a seamless creative workflow.
273
stars
181
commits
TypeScript
primary language
Jul 9, 2026
updated
A modern, AI-powered canvas application for generating and manipulating images and videos using OpenAI GPT Image, Google Gemini, Kling AI, Hailuo AI (MiniMax), and Fal.ai. Built with React, TypeScript, and Vite.
https://github.com/user-attachments/assets/7a64d4df-7ade-4bfa-b2cd-d615d267dd40
Transfer motion from a reference video to a character image - make anyone dance!
https://github.com/user-attachments/assets/1ee6cbf3-00a5-496e-852c-3304c6ebc6c9
Download all the generated videos and use video editting tool like CapCut to create a final video. Check result below.
https://github.com/user-attachments/assets/43cf8bb8-bf85-45f9-96da-657033126d94
https://github.com/user-attachments/assets/e6f89da5-d3a6-4889-a38b-672cf37bbd79
Transform any image by adjusting camera rotation and tilt angles.
https://github.com/user-attachments/assets/f0d678df-31ac-4431-bd7c-eea3950bfb1d
Create video storyboards with consistent characters and layouts.
https://github.com/user-attachments/assets/3c36de54-d37e-4875-8403-5b6e4a6216e0
Clone the repository
git clone https://github.com/SankaiAI/TwitCanva.git
cd TwitCanva
Install dependencies
npm install
Set up environment variables
Create a .env file in the root directory:
# Get from https://aistudio.google.com/app/apikey
GEMINI_API_KEY=your_gemini_api_key_here
# Get from https://app.klingai.com/global/dev/api-key
KLING_ACCESS_KEY=your_kling_access_key_here
KLING_SECRET_KEY=your_kling_secret_key_here
# Get from https://platform.minimax.io/user-center/basic-information/interface-key
HAILUO_API_KEY=your_hailuo_api_key_here
# Get from https://platform.openai.com/api-keys
OPENAI_API_KEY=your_openai_api_key_here
# Get from https://fal.ai/dashboard/keys (for Kling V2.6 Motion Control)
FAL_API_KEY=your_fal_api_key_here
# Optional: X (Twitter) Post Feature - Get from https://developer.twitter.com/en/portal
# See docs/post-to-x.md for detailed setup instructions
TWITTER_CLIENT_ID=your_twitter_client_id
TWITTER_CLIENT_SECRET=your_twitter_client_secret
TWITTER_API_KEY=your_twitter_api_key
TWITTER_API_SECRET=your_twitter_api_secret
TWITTER_ACCESS_TOKEN=your_twitter_access_token
TWITTER_ACCESS_TOKEN_SECRET=your_twitter_access_token_secret
TWITTER_CALLBACK_URL=http://127.0.0.1:3001/api/twitter/callback
# Optional: TikTok Post Feature - Get from https://developers.tiktok.com/
# See docs/tiktok-integration.md for detailed setup instructions
TIKTOK_CLIENT_KEY=your_tiktok_client_key
TIKTOK_CLIENT_SECRET=your_tiktok_client_secret
TIKTOK_CALLBACK_URL=https://your-ngrok-url.ngrok-free.app/api/tiktok-post/callback
โ ๏ธ Security: API keys are stored server-side only and never exposed to the client.
Start the development server
npm run dev
This starts both:
http://localhost:5173http://localhost:3001If you prefer using Docker to run the application in a containerized environment (recommended for deployment):
Clone the repository and set up .env (same as steps 1-3 above)
Run with Docker Compose
docker compose up -d --build
http://localhost:3001library/ folderdocker compose downTwitCanva supports running open-source AI models (like Stable Diffusion, Qwen Camera Control, ControlNet) locally on your GPU. This is optional - the cloud-based AI models work without this setup.
Requirements:
Setup:
# Option 1: Use npm script (recommended)
npm run setup:local-models
# Option 2: Run setup script directly
# Windows:
setup-local-models.bat
# Linux/macOS:
chmod +x setup-local-models.sh
./setup-local-models.sh
This will:
venv/)models/ directory structureAdding Models:
Download models from HuggingFace, Civitai, or similar sites (.safetensors, .ckpt, or .pt files) and place them in the appropriate folder:
| Folder | Model Types | Examples |
|---|---|---|
models/checkpoints/ | Main image generation models | Stable Diffusion 1.5, SDXL, DreamShaper, Juggernaut XL, Flux |
models/loras/ | LoRA adapters for styles/characters | Art styles, character LoRAs, detail enhancers |
models/controlnet/ | Guided generation models | OpenPose, Canny, Depth, Tile |
models/video/ | Video generation models | AnimateDiff, Stable Video Diffusion (SVD) |
Using Local Models:
๐ For detailed documentation, see docs/local-model-support.md
Transform your generated images with AI-powered camera angle manipulation using the Qwen Image Edit model.
For users without high-end GPUs, we provide a Modal-based cloud deployment.
Install Modal:
pip install modal
modal setup
Deploy the App:
modal deploy modal/camera_angle.py
Configure Environment:
Copy the generated generate endpoint URL and add it to your .env file:
VITE_MODAL_CAMERA_ENDPOINT=https://your-workspace--camera-angle-control-cameraangle-generate.modal.run
Managing Costs:
modal app stop camera-angle-control to disable the endpoint entirely.modal deploy modal/camera_angle.py again to re-enable.Tip: Stop the app when not actively using the feature to avoid any accidental charges.
This feature requires a 24GB VRAM GPU (RTX 3090/4090).
Download Models (~35GB):
# Activate venv
.\venv\Scripts\activate # Windows
source venv/bin/activate # Linux/macOS
# Download fast transformer (~20GB)
huggingface-cli download linoyts/Qwen-Image-Edit-Rapid-AIO \
--local-dir models/camera-control/qwen-rapid-aio \
--include "transformer/*"
# Download camera angle LoRA (~236MB)
huggingface-cli download dx8152/Qwen-Edit-2509-Multiple-angles \
้ๅคด่ฝฌๆข.safetensors \
--local-dir models/camera-control/loras
Configure HuggingFace Cache (Recommended):
By default, HuggingFace caches models to your C: drive. Move the cache to prevent filling up your system drive:
# Windows - Set cache to D: drive
[System.Environment]::SetEnvironmentVariable("HF_HOME", "D:\HuggingFace_Cache", "User")
# Restart terminal after running
# Linux/macOS - Add to ~/.bashrc or ~/.zshrc
export HF_HOME="/path/to/your/cache"
source ~/.bashrc
Start Camera Angle Server:
.\start-camera-server.bat # Windows
./start-camera-server.sh # Linux/macOS
# Server runs on http://localhost:8100
๐ For detailed documentation, see docs/camera-angle-control.md
All generated assets are automatically saved to local folders. These folders are created automatically when the server starts if they don't exist.
| Asset Type | Folder | File Format | Notes |
|---|---|---|---|
| Images | library/images/ | .png + .json | Auto-saved on generation |
| Videos | library/videos/ | .mp4 + .json | Auto-saved on generation |
| Workflows | library/workflows/ | .json | Manual save via UI |
| Chat Sessions | library/chats/ | .json | Auto-saved per message |
| Assets | library/assets/ | Various | User uploaded files |
fs.mkdirSync(dir, { recursive: true })/library/* URLs.json file with prompt, timestamp, and other infoNote: The
library/folder is in.gitignoreand won't be committed to the repository.
Ctrl/Cmd + Mouse Wheel or use the zoom sliderShift + Click or drag a selection boxAccess import tools via the Wrench icon in the left toolbar.
Download TikTok videos without watermark to use as motion references for the Motion Control feature:
Tip: The imported video will appear in your Video History and can be used as a motion reference when generating videos with Kling V2.6 Motion Control. This allows you to transfer dance moves, gestures, or any motion from TikTok videos to your AI-generated characters!
Note: First and last frames are automatically trimmed to remove TikTok watermarks (requires ffmpeg installed on your system).
Share your generated images and videos directly to Twitter/X:
Rate Limits (Free Tier): 17 posts/day, 85 media uploads/day. See Post to X Documentation for setup instructions.
Share your generated videos directly to TikTok:
Note: Unaudited apps can only post to private accounts. See TikTok Integration Documentation for full setup.
npm run dev # Start frontend + backend together
npm run server # Start backend server only (port 3001)
npm run build # Build for production
npm run preview # Preview production build
Your API key is never exposed to the browser:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Browser/Client โโโโโโถโ Backend :3001 โโโโโโถโ Gemini API โ
โ (No API key) โ โ (.env file) โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
.env (server-side only).env file is in .gitignoreImage Generation:
| Model | Provider | Image-to-Image | Multi-Image |
|---|---|---|---|
| GPT Image 1.5 | OpenAI | โ | โ |
| Gemini Pro | โ | โ | |
| Kling V1 | Kling AI | โ | โ |
| Kling V1.5 | Kling AI | โ | โ |
| Kling V2 New | Kling AI | โ | โ |
| Kling V2.1 | Kling AI | โ | โ |
Video Generation:
| Model | Provider | Text-to-Video | Image-to-Video | Frame-to-Frame |
|---|---|---|---|---|
| Veo 3.1 | โ | โ | โ | |
| Kling V1 | Kling AI | โ | โ | โ |
| Kling V1.5 | Kling AI | โ | โ | โ |
| Kling V1.6 | Kling AI | โ | โ | โ |
| Kling V2 Master | Kling AI | โ | โ | โ |
| Kling V2.1 | Kling AI | โ | โ | โ |
| Kling V2.1 Master | Kling AI | โ | โ | โ |
| Kling V2.5 Turbo | Kling AI | โ | โ | โ |
| Hailuo 2.3 | MiniMax | โ | โ | โ |
| Hailuo 2.3 Fast | MiniMax | โ | โ | โ |
| Hailuo 02 | MiniMax | โ | โ | โ |
| Hailuo O2 | MiniMax | โ | โ | โ |
| Kling V2.6 Motion | Fal.ai | โ | โ | Motion Control |
Chat:
See code-style-guide.md for detailed guidelines:
anysrc/components/src/hooks/server/index.jssrc/types.tsContributions are welcome! Please:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the Apache License 2.0.
If you are using this project for commercial purposes or building a commercial product, please refer to the NOTICE file for notification requirements.
Built with โค๏ธ using React, TypeScript, and AI APIs from OpenAI, Google, Kling, MiniMax, and Fal.ai (2025)
181 commits
TypeScript
72.6%
JavaScript
23.4%
Python
3.3%