Muse Studio is a local-first workspace for planning, visualizing, and iterating on stories and video concepts.
About Basic Usage Of Muse Studio : https://youtu.be/N9FTtNYHzIU
This is create as my hobby, if company want to customize for your workflow, feel free to reach out.
Any developers want to modify this open source project, feel free to reach out, so I can add you in the Contributor list.
It combines:
- A frontend (
muse-studio) with kanban-style scenes, characters, and “Muse” suggestions - A Python FastAPI backend (
muse_backend) that orchestrates LLMs and video/image providers - Tight integration with ComfyUI for image and video generation via your own workflows
This README covers installation, configuration, and day‑to‑day usage of the frontend and backend on your machine.
- What's New
- Prerequisites
- Clone / Open the Project
- Frontend Setup — muse-studio (Next.js)
- Backend Setup — muse_backend (Python / FastAPI)
- ComfyUI — Image & Video Generation
- Running the Stack
- Using Muse Agent (UI Overview)
- Verify Everything Works
- Quick Command Reference
- Upgrading PyTorch
- Troubleshooting
- Polished export (Remotion)
- Publishing on GitHub
- Credits & acknowledgments
- Security checks
- Changelog (releases)
Release 1.5.5 (2026-09-04) https://github.com/benjiyaya/Muse-Studio/releases/tag/v1.5.5
- Extensions + Ask Muse consolidation - Ask Muse capabilities are unified in the Extensions chat flow, with
/ask-museredirected to/mcp-extensions(query-compatible). - Built-in Muse orchestration tools - Added execution support for
muse.story,muse.visual, andmuse.motionin the unified executor while keeping the MCP tools panel MCP-only. - Session and context upgrades - Multi-session UX now supports create/switch/rename/delete/pin/search; session context persists
project_idandscene_id; chat shows active project context chip and improved empty-session start flow. - Attachment/upload improvements - Removed manual upload target selector and now derive upload target from session context (project-level vs session-level) with more reliable ID fallback behavior.
- Stability fixes - Added resilient DB/session schema checks, fixed
crypto.randomUUIDfallback in client IDs, and prevented strict MCP schema argument mismatches from extra injected fields.
Full release notes: see CHANGELOG.md (copy into the GitHub Releases description for tag v1.5.0).
Highlights — features
- Version 1.5.0 everywhere that matters: Settings → About,
GET /health(versionfield), and npm packages (muse-studio,@muse/plugin-host,@muse/plugin-sdk,mcp-muse-studio). - OpenRouter as a first-class LLM provider (env-based keys; Settings for model/base URL).
- Plugin extensions — Settings → Plugins; scene/playground generation can use ComfyUI or plugin providers with documented fallback behavior.
- MCP —
mcp-muse-studio/MCP adapter for external tooling. - Security —
scripts/security_dependency_guard.py+SECURITY.mdfor dependency/supply-chain checks.
Highlights — codebase
muse-studio/lib/generation/— story + batch scenes logic extracted from API routes (storyGenerationInternals,scenesBatchSupport,openRouterHeaders,comfyPluginGeneration).muse_backend/app/providers/llm/shared_prompts.py— shared Story Muse prompts for cloud/local LLM providers.useJobPoll/lib/jobs/jobPolling.ts— shared polling for Comfy and plugin jobs;lib/server/helpers for paths/ids.muse-studio/lib/plugin-extension/+ plugin API routes;packages/plugin-host,packages/plugin-sdk, template underpackages/plugin-template-zimage-turbo.APP_VERSIONinmuse_backend/app/main.py;HOST_MUSE_VERSIONin plugin types for third-party compatibility.
When all your scene videos are ready, Muse can help you turn them into a full film using the Video Editor Agent. You can let the agent assemble a master cut instead of downloading every clip and editing by hand.
- Simple Stitch — Use when you’re happy with each scene as it is. The agent takes all scenes marked as Final, arranges them in story order, and joins them into one continuous video. Fast and predictable.
- Smart Edit — The agent looks at each final scene, listens to audio, and samples key frames; it prepares an edited version of each scene (today mostly full content, designed to get smarter over time), then assembles them into the final film. Good foundation for future pacing and trimming.
In the UI, choose Simple Stitch or Smart Edit before clicking Export Full Film By Agent. Muse shows progress and then gives you a link to open or download the final film.
Muse Studio supports LM Studio as a local LLM provider alongside OpenAI, Ollama, and Claude.
- Run the LM Studio app and enable its OpenAI-compatible local server.
- In
muse_backend/.env(optional):LMSTUDIO_BASE_URL(defaulthttp://127.0.0.1:1234)LMSTUDIO_MODEL(model id from LM Studio’s/v1/models)LMSTUDIO_API_KEY(if you enabled API auth in LM Studio)
- In
muse-studio/.env.local:NEXT_PUBLIC_LMSTUDIO_BASE_URL=http://127.0.0.1:1234 - In Muse’s provider settings, choose LM Studio (Local) and pick a model. Story Muse (Ask Muse, storyline, scene dialogs) will use LM Studio instead of cloud or Ollama.
Disabling “thinking” output for Qwen models in LM Studio
Some models stream internal reasoning (“thinking”) plus the final answer. To hide that in Muse:
- In LM Studio → My Models, select your Qwen model.
- Open the Inference tab and find Prompt Template (Jinja).
- Add at the very beginning of the template:
{%- set enable_thinking = false %} - Save and restart inference for that model. Muse will then only show the final answer.
OpenRouter exposes many models behind one OpenAI-style API. Muse treats it as a first-class provider alongside OpenAI and Claude.
- API keys are never stored in the database or Settings UI. Set them only in environment files (same pattern as OpenAI and Anthropic).
muse-studio/.env.local(or your Next.js host env):OPENROUTER_API_KEY— required for storyline generation, Ask Muse, batch scene generation, and other routes that call the LLM from Next.js.muse_backend/.env:OPENROUTER_API_KEY— required when the active provider is OpenRouter for Python paths:POST /generate/story, long-form scenes (POST /agent/generate-scenes), and LangGraph agents that useget_chat_model.- Optional attribution headers (recommended by OpenRouter):
OPENROUTER_HTTP_REFERER,OPENROUTER_APP_TITLEin the same env files you use for that process. - In Settings → Language Model, choose OpenRouter, set the model id (e.g.
openai/gpt-4o-mini), and save. Model and base URL sync tomuse_config.jsonvia the backend; the key stays in.envonly.
Install these tools before starting.
| Platform | Install |
|---|---|
| Windows | Download from https://nodejs.org (LTS, v18+) |
| Linux | sudo apt install nodejs npm or use nvm |
Verify:
node --version
npm --version
Python 3.11 or 3.12 recommended (3.13 is also supported).
| Platform | Install |
|---|---|
| Windows | Download from https://python.org — check "Add to PATH" during install |
| Linux | sudo apt install python3 python3-venv python3-pip |
Verify:
python --version
Recommended for GPU‑accelerated features. Most flows will still run on CPU but more slowly.
| Platform | Install |
|---|---|
| Windows | Download CUDA Toolkit from https://developer.nvidia.com/cuda-downloads |
| Linux | sudo apt install nvidia-cuda-toolkit or use the NVIDIA runfile installer |
Verify:
nvidia-smi
| Platform | Install |
|---|---|
| Windows | https://git-scm.com |
| Linux | sudo apt install git |
git clone https://github.com/benjiyaya/Muse-Studio.git
cd Muse-StudioProject layout:
/ ← repo / project root
├── muse-studio/ ← Next.js frontend
├── muse_backend/ ← Python FastAPI backend
├── packages/
│ └── remotion-film/ ← Remotion “FilmMaster” composition (polished export)
└── README.md ← This file
Image and video generation run through ComfyUI; no local model folder is required in this repo.
-
Clone & install
- Backend:
cd muse_backend python -m venv .venv # Activate venv (see OS-specific commands below) pip install -r requirements.txt cp .env.example .env # or use Copy-Item on Windows
- Frontend:
cd ../muse-studio npm install # If .env.local.example exists: # cp .env.local.example .env.local # Else create .env.local and set at minimum: # MUSE_BACKEND_URL=http://localhost:8000 # NEXT_PUBLIC_OLLAMA_BASE_URL=http://127.0.0.1:11434 # if you use Ollama # NEXT_PUBLIC_LMSTUDIO_BASE_URL=http://127.0.0.1:1234 # if you use LM Studio
- Polished Remotion export (optional — needed for
SMART_EDIT_REMOTION/ FilmMaster renders):cd ../packages/remotion-film npm install
- Backend:
-
Configure keys
- Edit
muse_backend/.env:OPENAI_API_KEY(Story Muse)HF_TOKEN(for gated HuggingFace models, if you use them)- Optional video APIs:
KLING_API_KEY,SEEDDANCE_API_KEY,RUNWAY_API_KEY.
- Edit
-
Start services
- Backend:
Backend:
cd muse_backend # activate .venv python run.py
http://localhost:8000 - Frontend:
Frontend:
cd muse-studio npm run devhttp://localhost:3000
- Backend:
-
Run ComfyUI
- Start your ComfyUI server (local or remote).
- In the app UI (
/settings→ ComfyUI), set the ComfyUI base URL and register one or more workflows.
-
Create a project
- Open
http://localhost:3000, create a new project, pick a Muse Control Level (Observer / Assistant / Collaborator), then add scenes and generate images / video via your ComfyUI workflows.
- Open
cd muse-studio
npm installCreate the local environment file:
copy .env.local.example .env.localIf
.env.local.exampledoes not exist, create.env.localmanually with:MUSE_BACKEND_URL=http://localhost:8000 # Optional local LLM servers (frontend URLs) NEXT_PUBLIC_OLLAMA_BASE_URL=http://127.0.0.1:11434 NEXT_PUBLIC_LMSTUDIO_BASE_URL=http://127.0.0.1:1234
Start the dev server:
npm run devFrontend runs at http://localhost:3000
cd muse-studio
npm install
cp .env.local.example .env.local # or create manually — see above
npm run devAll commands below are run from inside the muse_backend/ directory unless stated otherwise.
The .venv isolates AI model dependencies (especially CUDA PyTorch) from your
system Python. Never skip this step.
cd muse_backend
python -m venv .venvcd muse_backend
python -m venv .venvcd muse_backend
python3 -m venv .venvYou must activate the venv every time you open a new terminal.
Your prompt will show (.venv) when active.
.venv\Scripts\activate.bat.\.venv\Scripts\Activate.ps1If you see an execution policy error, run once:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
source .venv/bin/activateDeactivate when done:
deactivate
Critical: Do NOT install torch from
requirements.txtor plainpip install torch. Both give a CPU-only build with no GPU support. Always use the--index-urlflag.
First, check your CUDA version:
nvidia-smi
Look for the CUDA Version in the top-right of the output, then pick the matching install command below.
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Verify GPU is detected after install:
python -c "import torch; print('Torch:', torch.__version__); print('CUDA:', torch.cuda.is_available()); print('GPU:', torch.cuda.get_device_name(0))"
Expected output example:
Torch: 2.10.0+cu128
CUDA: True
GPU: NVIDIA RTX PRO 6000 Blackwell Workstation Edition
pip install -r requirements.txt
This installs FastAPI, Uvicorn, OpenAI SDK, and other non-GPU packages.
copy .env.example .envCopy-Item .env.example .envcp .env.example .envThen open .env and fill in your API keys:
# OpenAI (Story Muse, cloud)
OPENAI_API_KEY=sk-...
# HuggingFace (required for gated models like FLUX.2-klein safetensors)
HF_TOKEN=hf_...
# Local LLMs (optional)
# Ollama — local LLM server
# OLLAMA_BASE_URL=http://localhost:11434
# OLLAMA_MODEL=llama3.2
# LM Studio — local LLM server (OpenAI-compatible API)
# LMSTUDIO_BASE_URL=http://localhost:1234
# LMSTUDIO_MODEL=gpt-4o-mini
# LMSTUDIO_API_KEY=your_token_if_enabled
# Cloud video APIs (optional — set whichever you use)
KLING_API_KEY=
SEEDDANCE_API_KEY=
RUNWAY_API_KEY=
Image and video generation are handled by ComfyUI. Run ComfyUI separately and integrate its workflows into Muse Studio:
- In ComfyUI, rename your input and output nodes so their titles end with (Input) or (Output) — Muse uses these suffixes to detect dynamic inputs and output.
- In ComfyUI, open your workflow and export it as API JSON (or copy the JSON from the workflow editor).
- In Muse Studio, go to Settings → ComfyUI → Add workflow and paste the ComfyUI JSON.
- Give the workflow a clear name, choose its kind (image or video), and save it.
- Your saved workflows now appear in the Muse workflow library and can be:
- Assigned per scene on the kanban board (image / video workflow fields).
- Used from “Generate with ComfyUI” dialogs for scenes and character sheets.
You do not need a models/ folder in this repo — model weights and pipelines live entirely in your ComfyUI installation.
Both services must be running simultaneously. Use two separate terminal windows.
cd muse_backend
.venv\Scripts\activate.bat
python run.pycd muse_backend
.\.venv\Scripts\Activate.ps1
python run.pycd muse_backend
source .venv/bin/activate
python run.pyBackend starts at:
- API: http://localhost:8000
- Docs: http://localhost:8000/docs
- Health: http://localhost:8000/health
cd muse-studio
npm run devcd muse-studio
npm run devFrontend starts at http://localhost:3000
Once both backend and frontend are running and ComfyUI is configured:
-
Create a project
- Go to
http://localhost:3000. - Click New Project and enter:
- Title and optional Description.
- Muse Control Level:
- Observer – light, occasional suggestions.
- Assistant – balanced help (default).
- Collaborator – very proactive suggestions.
- Go to
-
Storyline and scenes
- Define your storyline for the project.
- Add scenes on the kanban board; Muse can suggest improvements based on your control level.
-
Characters
- Use the Characters panel to define key characters.
- Optionally generate character sheet images via ComfyUI workflows when available.
-
ComfyUI workflows (image & video)
- In Settings → ComfyUI, register one or more workflows from your ComfyUI instance.
- On the kanban board, assign:
- An image workflow per scene for stills.
- A video workflow per scene for motion.
- For video workflows, ensure the workflow's (Output) node uses the native
SaveVideonode from comfy-core, so the backend downloads an actual playable.mp4(not a PNG thumbnail). - Use the Generate with ComfyUI dialogs on scenes or character sheets to run those workflows, then review results.
-
Muse suggestions
- As you confirm storylines, edit scenes, and complete video jobs, Muse surfaces suggestions in the UI.
- You can adjust the project’s Muse Control Level later from the project header if you want more or fewer suggestions.
Open in browser or run:
curl http://localhost:8000/healthcurl http://localhost:8000/healthExpected response (example):
{
"status": "ok",
"version": "1.5.5",
"available_providers": { ... }
}python -c "import torch; print(torch.__version__, '| CUDA:', torch.cuda.is_available(), '| GPU:', torch.cuda.get_device_name(0))"
python -c "from diffusers import LTXImageToVideoPipeline; print('diffusers OK')"
python -c "from ltx_core.model.upsampler import upsample_video; print('ltx_core OK')"
| Task | Windows CMD | Windows PowerShell | Linux / macOS |
|---|---|---|---|
| Activate venv | .venv\Scripts\activate.bat |
.\.venv\Scripts\Activate.ps1 |
source .venv/bin/activate |
| Deactivate venv | deactivate |
deactivate |
deactivate |
| Start backend | python run.py |
python run.py |
python run.py |
| Start frontend | npm run dev |
npm run dev |
npm run dev |
| Check GPU | nvidia-smi |
nvidia-smi |
nvidia-smi |
| Check CUDA in Python | python -c "import torch; print(torch.cuda.is_available())" |
same | same |
| Install a new package | pip install <pkg> |
pip install <pkg> |
pip install <pkg> |
| Freeze dependencies | pip freeze > requirements.txt |
same | same |
When a new PyTorch version is released, upgrade with the same CUDA index URL.
Do not use plain pip install torch --upgrade — that installs a CPU build.
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128 --upgrade
After upgrading, verify CUDA is still available:
python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
PyTorch was installed without the --index-url flag. Fix:
pip uninstall torch torchvision torchaudio -y
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
.venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled
Fix (run once as your user):
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserAfter installing ltx-core, always verify and reinstall if needed:
python -c "import torch; print(torch.__version__)"
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
Visual Studio C++ Build Tools are missing. Install them first (one-time):
winget install Microsoft.VisualStudio.2022.BuildTools --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows11SDK.22621"After it finishes, close and reopen your terminal, then retry the llama-cpp-python install step in Section 5 (Backend Setup).
It was installed without CMAKE_ARGS. Uninstall and rebuild:
pip uninstall llama-cpp-python -y
set CMAKE_ARGS=-DGGML_CUDA=on
set FORCE_CMAKE=1
pip install llama-cpp-python --no-cache-dirpip uninstall llama-cpp-python -y
CMAKE_ARGS="-DGGML_CUDA=on" FORCE_CMAKE=1 pip install llama-cpp-python --no-cache-dirYou are not inside the .venv. Activate it first, then retry:
# Windows CMD
.venv\Scripts\activate.bat && python run.py
# Linux / macOS
source .venv/bin/activate && python run.py
- Make sure the Python backend is running in a separate terminal
- Check
muse-studio/.env.localcontainsMUSE_BACKEND_URL=http://localhost:8000 - Confirm the backend is healthy:
curl http://localhost:8000/health
netstat -ano | findstr :8000
taskkill /PID <PID> /Flsof -ti:8000 | xargs kill -9The packages/remotion-film package is a Remotion composition used for Muse FilmMaster exports (polished timeline render). The Python backend can shell out to npx remotion render from this directory when you use the Remotion-based export path. For backend environment variables (MUSE_VIDEO_HTTP_BASE, MUSE_REMOTION_PACKAGE_PATH), see muse_backend/README.md → Polished export (Remotion) — optional.
- Node.js 18+ (LTS recommended) and npm on your
PATH. npx(ships with npm) — the backend invokesnpx remotion renderfrom this package directory.
From the repository root:
cd packages/remotion-film
npm installRun npm install again after dependency changes or a fresh clone.
- By default the backend expects this project at
<repo>/packages/remotion-film. - If it lives elsewhere, set
MUSE_REMOTION_PACKAGE_PATHon the backend to the absolute path of the folder that containspackage.json.
Remotion loads scene clips over HTTP(S) during render. The backend rewrites timeline URLs using MUSE_VIDEO_HTTP_BASE (see muse_backend/README.md).
- Default:
http://127.0.0.1:3000(typicalmuse-studiodev server). - Set
MUSE_VIDEO_HTTP_BASEon the Python backend to match wherever Muse Studio is reachable from the machine running the render (often the same idea asMUSE_FRONTEND_BASE_URLinmuse-studio/.env.local, but Next.js does not load that file into Python — set the backend env explicitly or viamuse_backend/.envif your launcher loads it).
Muse Studio must be running and able to serve /api/outputs/... at that origin while an export runs.
Preview the composition locally:
cd packages/remotion-film
npm run studioRequires a props JSON file (same shape as the backend FilmTimeline):
cd packages/remotion-film
npx remotion render src/index.ts FilmMaster out/video.mp4 --props=timeline.fixtures.jsonFixture render (writes props then renders):
npm run render:fixtureTimeline JSON may include transitionOut on each sequence except the last (Muse strips it on the final clip). type: "fade" with durationSec produces a crossfade via @remotion/transitions (TransitionSeries + fade()). cut or missing values are hard cuts. Durations are clamped to the shorter of the two adjacent clips and to a small minimum fade length in the Remotion layer.
Smart Edit / Remotion export: the editor LLM supplies transitionOut per scene; the backend normalizes it (fade duration clamped to 0.05–2.0 s, unknown types become cut).
ffmpeg-only Smart Edit master concat does not apply these transitions; polished Remotion export and the Muse Studio player preview do.
| Variable | Where | Purpose |
|---|---|---|
MUSE_REMOTION_PACKAGE_PATH |
Python backend | Optional absolute path to this package if not under <repo>/packages/remotion-film. |
MUSE_VIDEO_HTTP_BASE |
Python backend | Origin where Muse Studio serves video URLs Remotion will fetch (default http://127.0.0.1:3000). |
This repository is hosted at github.com/benjiyaya/Muse-Studio.
- Do not commit API keys or secrets: use
muse_backend/.envandmuse-studio/.env.local(see.gitignoreand.env.examplefiles). - Generated media under
muse-studio/outputs/(draft images, videos, timelines, final cuts) is ignored so clones stay small; recreate outputs locally after install. muse-studio,muse_backend, andpackages/(includingpackages/remotion-film) are all part of the same repo — clone once at the root and follow the setup sections above.
This project is licensed under the MIT License — see LICENSE.
Remotion — Muse Studio’s polished film export and timeline preview build on Remotion, the React-based framework for programmatic video. Thank you to the Remotion team and community for the tools and documentation that make headless, code-driven rendering practical in this stack.
Run the supply-chain guard script from repo root:
python scripts/security_dependency_guard.pyThe guard scans for known IOC strings and denylisted dependency versions (including litellm==1.82.8), then exits non-zero on findings so it can be used in CI.
For remediation guidance, see SECURITY.md.
Version history and detailed release notes (features, codebase paths, docs) live in CHANGELOG.md. For v1.5.0, open that file and paste the [1.5.0] section into the GitHub Release body for tag v1.5.0 if you want the web UI to mirror the repo.