# Security and privacy Plenio runs inside ComfyUI on your own machine. This page lists everything it does beyond computing inside ComfyUI's process: what it downloads, which programs it starts, which addresses it talks to and which files it writes. ## Network - **Plenio's own assets, on first use.** The lyrics ASR models - Qwen3-ASR 1.7B and Qwen3-ForcedAligner 0.6B (4.1 + 1.8 GB, Apache-2.0), and faster-whisper large-v3 (3 GB, MIT) only for a language the aligner cannot time - are fetched from Hugging Face when *Transcribe Lyrics* or the lyrics subtitles first need them; the default writer's Gemma 4 12B GGUF (9.8 or 6.7 GB by graphics card, Apache-2.0, into `models/LLM`) when a song is written and no Gemma 4 12B is on the machine - each from a revision pinned to a full commit hash, with the sizes and the SHA-256 of the weights checked (`resources/assets.toml`, `plenio/core/assets/fetch.py`). `PLENIO_OFFLINE=1` (or `HF_HUB_OFFLINE=1`) turns this off; point `[asset_paths]` in Plenio's `config.toml` at a copy you already have. - **Model files of the templates, after you confirm** (since 2.0, [ADR-0014](docs/adr/0014-downloads-after-confirmation.md)). Plenio Setup shows the plan - each file, why, its folder, its licence, the total size and whether it fits on its drive - and fetches nothing before *Download all*. Only files the catalogue names are fetched (`resources/models.toml`: each pinned to a commit of its repository, with its size and SHA-256, checked before the file is put in place; `plenio/core/assets/downloads.py`), from their Hugging Face repository or the mirror you set in `HF_ENDPOINT`. `[models] downloads = "ask"` (the default) never fetches during a run - a run that lacks a file names it and opens Setup; `"auto"` lets a run fetch what it lacks; `"off"` never fetches. A model whose makers ask for an agreement is shown with the steps to take; Plenio never accepts one for you. - **A Hugging Face token** for such a model is read from `HF_TOKEN` (or `HUGGING_FACE_HUB_TOKEN`), or saved by Setup through `huggingface_hub.login` (in Hugging Face's own place, not in a file of Plenio's); it is sent to huggingface.co only - never to a mirror, and never along a redirect to another host (`plenio/core/assets/hub.py`). - **Local LLM** talks only to language-model apps on your machine: their default local addresses (`127.0.0.1`: LM Studio, Ollama - which honours `OLLAMA_HOST` -, llama.cpp, vLLM, Jan, KoboldCpp, text-generation-webui, GPT4All, Unsloth Studio), the llama.cpp server it starts itself on a free local port, and the servers you add in `[llm.servers]`. A system proxy is bypassed for these requests. `[llm] other_apps = false` (or `PLENIO_LLM_OTHER_APPS=0`) keeps it to ComfyUI's own `models/LLM` folder. The keys of language-model servers are read from environment variables, never stored by Plenio. - **Listening beyond this computer** only when you switch it on in the Plenio Player: *guests in your network* (Live Play, port 8770) and *In your network* (Settings, ports 8780-8789) - see [The Plenio Player](#the-plenio-player). Everything else of Plenio listens on `127.0.0.1` only (unless you start the player with `--host`). - No telemetry, no cloud service, no account with anyone - the Plenio Player's login (since 1.2.0) is local to the player's computer. ## Programs Plenio starts Plenio comes in two forms (since 2.0). The **Comfy Registry package** (ComfyUI Manager, `comfy node install`) starts nothing but **this Python with Plenio's own modules**. The **full download** (`git clone`, the release zip) adds the *Studio add-on* (`plenio/addons`): three conveniences that start another program. **0 · System Check** says which form is installed; `PLENIO_ADDONS=0` switches the add-on off where it is installed. ### In every installation: this Python, Plenio's own modules Three places, each a command written as a list whose first element is `sys.executable` - no shell, no command line built as one string, no program named by a setting or an environment variable: - **The lyrics ASR worker** - `python -m plenio.workers.asr` with the Python ComfyUI runs on (`sys.executable`), in a separate process so its memory is freed afterwards (`plenio/core/workers/protocol.py`: a fixed command line, no shell). Qwen3-ASR runs there on ComfyUI's installed transformers with the inference code Plenio carries (`plenio/third_party/qwen3_asr`, from transformers 5.17, per-file hashes in its `NOTICE.md`). For the faster-whisper fallback it adds, on Windows, the CUDA library folders of the installed packages to its own `PATH`, so CTranslate2 finds cuBLAS and cuDNN. - **The Plenio Player, from ComfyUI** - `python plenio_player.py`, when the *Plenio Player* button finds no player running (`plenio/player/launch.py`; see [The Plenio Player](#the-plenio-player)). - **llama-cpp-python**, when that package is installed, for a GGUF file chosen in *Local LLM* - `python -m plenio.workers.llama_http`, listening on `127.0.0.1` only and stopped after the answer unless *keep loaded* is on (`plenio/core/llm/runtime.py`). A player started by hand opens its own page (`http://127.0.0.1:/`) in your browser (`plenio/player/__main__.py`); a player started from ComfyUI does not. **Checked on the package itself.** `tools/package_gate.py` reads the syntax tree of every Python file in the packed zip and fails the build on: a process call outside these three files, a command that is not such a list, `shell=`, `os.system`, `os.startfile`, `os.exec*` or `os.spawn*`, an asyncio subprocess, `eval` or `exec`, an import of `pip`, `pickle` reading data, a browser opened anywhere else, and any script or binary file in the package. The CI runs it on the zip of every push (job *Registry package*); `python tools/package_gate.py node.zip --delta ` prints what changed against a version. ### Only in the full download: the Studio add-on - **ComfyUI, from the Plenio Player** (*Settings › The studio*, off until the admin starts it or switches on *Start it by itself when a song is ordered*): ComfyUI's own `main.py` in the folder the admin chose (empty: the ComfyUI Plenio is installed in) - a ComfyUI folder, its `main.py` beside `folder_paths.py`, `execution.py` and the `comfy` package (the player runs no other `main.py`) -, with that ComfyUI's Python (the portable build's `python_embeded`, a `.venv` or `venv`, else the player's) - a fixed argument list without a shell, without a window, detached, its output in `comfyui.log` in the player's state folder (`plenio/addons/studio_launcher.py`; the settings in `plenio/player/studio.py`). The admin's extra arguments are split like a command line and checked: `--listen`, `--enable-cors-header`, `--port` and the TLS arguments are refused, so ComfyUI stays on this computer, on the port the player set. Only a browser on this computer itself sets it up, starts and stops it - from the player's own page (JSON, its own origin), the admin, from a loopback address and not through a gateway of *In your network*; a player started with `--host` refuses these requests from other computers too. From the network the player says only whether ComfyUI runs, never its folder, command or log. The player stops only a ComfyUI it started itself (on Windows with its child processes, `taskkill /T`), by hand or after the idle minutes the admin chose (never by default). The settings are `studio.json` in the player's state folder. With no arguments of the admin's, the player starts ComfyUI the way it was last started: whenever ComfyUI loads Plenio with the add-on, Plenio writes its Python, its `main.py` and its arguments - without `--listen`, `--port`, `--enable-cors-header` and the TLS arguments - into `comfyui-start.json` in the player's state folder (`plenio/comfy/extension.py`), and the player leaves these out again when it reads them - and starts the Python named there only when its file name is a Python interpreter's (`python`, `python3.12`, `python.exe` ...). - **A `llama-server` program** for a GGUF file chosen in *Local LLM* - the one you installed (found on the PATH, in Unsloth Studio, winget or Homebrew), or the one `PLENIO_LLAMA_SERVER` or `[llm] llama_server` names - a program whose name begins with `llama-server`, or its folder: a configuration names no other program to run -, started with an argument list, listening on `127.0.0.1` only and stopped after the answer unless *keep loaded* is on (`plenio/addons/llm_server.py`). - **The file manager** - *Open the folder* in the player shows one of the player's own folders (its shared players, its videos, your visuals): Explorer, `open` or `xdg-open` with the folder as one argument of an argument list (`plenio/addons/file_manager.py`). A folder whose name holds a comma is handed to the shell's *open* instead (`os.startfile`), because Explorer splits its own arguments at commas. No route passes a path of the request on, and no file is selected in the folder (that needed a command line built as a string, until 1.6.0). Without the add-on: the player uses the ComfyUI that runs and says how to start one; GGUF files run in an app that is running (LM Studio, Ollama, a `llama-server` you started) or with llama-cpp-python, else ComfyUI's own Gemma writes; *Open the folder* shows the folder's path with a button that copies it; ComfyUI keeps no note of how it was started. The two start scripts `Plenio Player.bat` and `plenio_player.sh` are part of the full download too. Plenio installs no Python packages. When a feature needs one (faster-whisper; transformers 5.5 or newer for Qwen3-ASR), it names the command for you to run. ## Files Plenio writes - **ComfyUI's output folder** (`output/plenio` by default): the exported audio, cover art, sheet music PDF, the song's page (`.html`: one static page from the record - its texts escaped, its style and a small script for its copy buttons inside, nothing loaded from the network) and release record - the record also inside the song's FLAC (*project in FLAC*, on by default; off with ComfyUI's `--disable-metadata`), with the same redactions; the stems marked *save* in the Stem Mixer, next to the song in `-stems` (without an export in `output/plenio/stems`). - **ComfyUI's user folder** (`user/plenio`): your brief templates and creative modes, `config.toml`, and caches (lyrics ASR results, Local LLM answers) that make runs repeatable. The score editor keeps your sound presets in ComfyUI's own user data. - **The models folder**: the ASR models (`models/plenio/asr`). **YuE2 LoRAs** only reads the LoRA files chosen in it from ComfyUI's `loras` folders - safetensors, or a torch file without pickled code (ComfyUI's safe loader) - and the `adapter_config.json` or `.json` beside one; it writes nothing. - **Files you open in the score editor** (MIDI, MusicXML, project files) are read by your browser and parsed by Plenio in memory - MusicXML with the standard library, only Plenio's own files, entity declarations refused and no DTD fetched; nothing is written but the score you apply. - **The temp folder**: a worker's job folder and a llama.cpp server's log while they run, removed afterwards. ## The Plenio Player The player (`python plenio_player.py`, `python -m plenio.player`; in the full download also `Plenio Player.bat` and `plenio_player.sh`) is a separate program. ComfyUI never serves it; its **Plenio Player** button calls `POST /plenio/player/open` - which answers only a browser on this computer, see [Plenio's HTTP routes](#plenios-http-routes) - which looks for a running player on `127.0.0.1:8765-8769` and, when none answers, starts one with ComfyUI's own Python - a fixed argument list without a shell, in the background, detached so that it keeps running when ComfyUI stops, its output in `player.log` in the player's state folder (`plenio/player/launch.py`). It serves a web page and the songs of the folders you give it (ComfyUI's output folder by default) on `127.0.0.1:8765`. It answers only requests addressed to `127.0.0.1` or `localhost` (no other web page can reach it under a name of its own), serves only the files a release record lists in the record's own folder, and sends no CORS headers, so other web pages cannot read from it or change its state. `--host` opens it to a network; its login (below) keeps the listeners' things apart but is no protection for an open network, so do this only on a network you trust. Started so, it counts as this computer - with the host's rights - only a connection from a loopback address or from one of the computer's own addresses (since 2.0; before, every device it reached directly): a port forwarder, VPN or NAT that hands connections on from the computer's own address counts as this computer too. It writes into the songs' folders only when you remove a song, release one that waited to be released (below) or the admin rates one by ear (below). Only the admin and the admins' group remove songs (since 1.4.0; listeners, makers and guests keep their own playlists, not the songs). A song you remove moves its files to `_retired` in the library folder, or they are deleted when you choose *Delete permanently* and confirm it - only the files in the song's own folder, and only on a request from the player's own page that names the song twice (JSON, which another site's page cannot send without asking first, and the page's own origin). Your playlists, favourites, tags, play counts, settings, its library cache and the songs' waveforms go to `~/.plenio/player` (or `PLENIO_PLAYER_STATE`). Your Plenio Drop presets are `.json` files in its `visuals` folder: the page reads them (at most 200, up to 256 KB each) and evaluates their formulas with its own small calculator - numbers, names and a fixed list of functions, never script - so a preset someone shares can only draw. *Edit a copy* writes a new file there (never over an existing one), and *Open my folder* shows that folder in the file manager; both only on a request from the player's own page. The folders it reads are chosen on its Settings page and kept in `library.json` there; its folder browser lists the names of folders (never files) of this computer, and only for the player's own page (a request header another page cannot send without asking first); a folder is saved only from the player's own page (JSON, its own origin) and only when it exists. In a folder with *also other music* it serves the audio files no release record owns, their lyrics and covers - files in that folder only - and saves a picture embedded in such a file once into its cache to show it. *Save as a video* sends the video the page encoded to the player in pieces (a request header another site's page cannot send without asking first, and the page's own origin); the player puts it together with the song's own audio file into an MP4 in its `videos` folder with PyAV and serves only the MP4 files in that folder. Unfinished videos are removed after a few hours. *Share as a player* writes one HTML file - or parts of at most 250 MB, 500 MB or 1 GB - into its `packages` folder, on a request from the player's own page: the player's page code and, of the songs chosen, MP3s (at most 192 kbit/s), small covers, the timed lyrics and notation, waveforms and optionally the sheet music PDFs, your visuals' settings and preset files, your playlists of those songs and, when you choose, your tags of them - never a release record, a workflow, a FLAC/WAV or a path of this computer. The shared file runs in the recipient's browser without any server: it keeps their playlists and settings in that browser and sends nothing anywhere. **Guests in your network** (Live Play, off until you switch it on): a second server of its own, on port 8770 (8771-8779 when taken) and on every network (`--guests-host` for one address), so phones on the same network reach it - one of the two parts of Plenio that listen beyond this computer (the other: *In your network*, below). It answers only below a random path of 16 characters (about 96 bits, `secrets.token_urlsafe`; *New address* replaces it, and the old one answers 404), and below it only: its own page (a strict Content Security Policy, no referrer, so the address goes to no other site), the live playlist as the player's page shows it - song ids that the player turns into titles, genre or artist, lengths and covers from its library -, the covers of the library's songs, and when you allow guests to change the playlist, a search of the library's titles and their wishes (a song up, down, out, or added; JSON only, at most 40 a minute per address). Their **reactions** to the song that plays (on until you switch them off) are one of six names (fire, heart, party, clap, dance, laugh - the pages draw the emoji), JSON only, at most 60 a minute per address, and only while the player's page shows a song; the player keeps the last 300 in memory and writes each song's counts into `reactions.json` in its state folder - with *one per song and guest*, also which kind each guest gave, under the SHA-256 of the guest's random cookie (`plenio_maker`, below), never an address. It serves no record, no workflow, no path and no setting, and the audio of two kinds of songs only (since 1.4.0): a guest's own song waiting to be released, to their cookie (below), and - while *Hear again* is on (on by default) - the songs made at this party that played, so every guest hears them again on their phone. A party begins when the access is switched on, gets a new address, or the host starts a new one; its songs - those made through the player's party songs since then that the player's page reported as played - are kept in `party-played.json` in the state folder, and the guests' server sends no other song's audio. Audio goes out in parts as a phone's player asks (`Range`), with the page's headers; the page's Content Security Policy allows media from its own server only. It writes only its own settings (`guests.json` in the player's state folder: on, what guests may do, whether they may react and how often per song, whether they hear the party's songs again and since when, the screen, the path and the port), the reactions' counts and the party's songs. The player's page carries out the wishes itself. Windows asks once whether Python may accept connections; leave the access off on networks you do not trust. **The player in your network** (Settings › *In your network*, off until you switch it on): two small gateways of the player's own on ports 8780-8789, on every network (`--network-host` for one address) - one passes requests on to the player, the other to the ComfyUI running on this computer (looked for on loopback addresses only), which keep listening on this computer only. They let in only a browser that came with the link: its random part of 16 characters (about 96 bits) sets a cookie with the same code (HttpOnly, SameSite=Lax, for a year); any other request gets a short page that says how to come in. *New link* replaces the code: the old link and every browser let in by it are out. A gateway passes a request on addressed to the loopback address, its own cookie taken out, and marks it as from the network (`X-Plenio-Remote`, a header the player believes from loopback only; a browser's own value is taken out): from there the player does everything but choose its folders, list this computer's folders, stop, open a folder on this computer's screen, delete songs for good (it retires them) and switch the access itself, and it names no place of this computer - folders and files only by their names - and of a failure only that it failed (since 1.4.0). Plenio's routes in ComfyUI answer what only this computer may ask - the System Check's report, starting the player - not this way either (since 1.4.0). Through the second link ComfyUI can do from the network all it can do here - run workflows, read and write in its folders -, so give the links only to people and devices you trust and make a new one when a link is lost. The links work over plain HTTP in your network. The settings (`network.json` in the player's state folder: on or off, the code, the ports) stay with the player (`plenio/player/network.py`). *Open the folder* (after a video or a shared player, and in Settings) shows the player's own `visuals`, `videos` or `packages` folder in the file manager - on Windows it starts Explorer itself with that folder (and the new file chosen) as its only argument, without a shell (a path with a quote in it is refused, so nothing of a name becomes an argument of its own); elsewhere `open` or `xdg-open` - only on a request from the player's own page, and never another folder (`plenio/player/visuals.py`). A second player on a taken port does not start. To find ComfyUI for *Open in ComfyUI* it asks only loopback addresses (`127.0.0.1:8188`, `:8000`, or the one you set - an address of a page's own only from this computer, so the network cannot have it knock at this computer's ports); the ComfyUI page takes a song's record only from its own origin or a loopback one. Its page cannot be shown in a frame of another site (`X-Frame-Options: SAMEORIGIN`, `frame-ancestors 'self'`), so no other page can lay its buttons under a click of its own; every answer says `nosniff`. Reading the folders again (*Look for new songs*) only on a request from its own page. `/page/` renders the same song's page from a song's record (`plenio/player/song_page.py`), with links to the player's own `/media/` files. **Stars** (since 1.4.0): the stars a listener gives a song by ear are kept in their state (song ids and 0 to 5 in halves, nothing else); the admin's also go into the song's own page beside it (`.html`) - only a page Export Release wrote there, never a new file, written anew in the background for the songs whose stars changed, on a save of the admin's own state (from the player's own page, like every state). How well a song came out, measured, is read from its record; for a song exported before 1.4.0, `/api/quality/` decodes its audio file with PyAV (at most its first seven minutes) and keeps the result in `cache/quality.json` in the player's state folder (`plenio/player/measured.py`). The visuals' **analysis track** (since 2.0: beats, bars, sections and drops for the Director) is computed from a library song's own audio file - one song at a time, at most its first fifteen minutes - by `GET /api/analysis/`, which takes only a song's id and answers no place; it is kept in `cache/analysis` in the state folder and goes along into a shared player (`plenio/player/analysis.py`). The small pictures of the covers that the library's cards show are made by Pillow from the songs' own covers into the player's `cache/thumbs` folder (a few sizes only). It downloads nothing and talks to no other address (`plenio/player/server.py`). **Who is listening** (the player's login, since 1.2.0; `plenio/player/accounts.py`). The page opens with a choice: a **user** of this player, the **admin**, or a **guest**. Users are set up by the admin in *Settings > Accounts* (a name, a password of at least 4 characters, a picture); each keeps their playlists, favourites, plays, tags and settings on the player's computer in a folder of their own (`users//` beside the state). Passwords are kept only as PBKDF2-SHA256 hashes (240 000 iterations, a random salt per user, compared in constant time) in `users.json` beside the state; a login gives the browser a random session token in a cookie (`plenio_session`: HttpOnly, SameSite=Lax, for 400 days from the login), of which the player keeps only the SHA-256; a new password or a removed user ends their sessions, and logging out ends the device's. Eight wrong passwords (or invitation codes) from one device in ten minutes make it wait - counted by the device's own address, which the gateway of *In your network* passes on in a header of its own (a browser's copy is taken out), never by a name the browser sends -, and twenty for one user from any number of devices (since 2.0). **Invitations** (since 2.0, *People & access*): the admin or a helper names a person and a group and gets a one-time code (96 random bits, valid 15 minutes, kept only as its SHA-256); the invited device sets a password or a four-digit PIN with it and is logged in. The invitation's QR code carries the link of *In your network* (so the phone reaches the player): whoever has that link comes into the player as a guest for as long as the link is not renewed - *New link* shuts out every device let in by it. The **admin** is the player's state as it was (`state.json`) and logs in only from the player's own computer: a request that comes from the network - directly with `--host`, or through a gateway of *In your network* - never acts as the admin, also not with an admin's session (since 2.0 this holds for `--host` too: before, a device reaching such a player directly counted as this computer); without a session a request from this computer is the admin (as before the login), one from the network a guest. Every user is in a group (since 1.4.0): *listener* (may not make songs), *maker*, or *admin* - a helper with the admin's rights over the network: with their password, from any device, they set up and remove users and set their groups, approve songs, change the party's and the guests' settings and start ComfyUI from a browser on this computer; they keep their own state, never the admin's, and what only this computer does (choosing folders, stopping the player, deleting songs for good, switching *In your network*) stays refused from the network for them too. Make a user a helper only if you would give them your seat at this computer; only an admin sets a user's group. A **guest** keeps everything in that browser and nothing on the player's computer. Pictures are checked by their first bytes (PNG, JPEG or GIF, at most 2 MB) and served only from the users' folder. The login keeps listeners apart; it is not meant to guard a player that is open to a network you do not trust. **Party songs** (since 1.3.0, off for users and guests until the admin switches them on in *Settings > Party songs*; the player in your network has the whole studio, see below; `plenio/player/maker.py`). Users, guests of the player and - when allowed - the guests in your network order songs; the player keeps the line in `party-songs.json` in its state folder and sends one song at a time to the ComfyUI on this computer (looked for as for *Open in ComfyUI*: on loopback addresses, or the one you set) through the Song API below. An order is a set of the template's own fields: a style must be one of the templates, a value is text of limited length, and the admin sets how many songs each person may have in the line (1-20, the admin unlimited), the longest length and whether covers are allowed; the line takes at most 40 songs. A recording for a cover is at most 100 MB, one of the usual audio types, checked by opening it with PyAV, kept in `party-sources` in the state folder and removed with its song (one no song uses after six hours); the guests in your network send at most 6 a minute per address, with a request header another site's page cannot send without asking first. A guest in your network is told apart by a random cookie (`plenio_maker`: HttpOnly, SameSite=Lax, for a year) of which the player keeps only the SHA-256; it limits a person's songs, not who can order - a guest who clears it gets a new one, and the admin can take any song out of the line. The guests' make page (`//make/`) has the same strict Content Security Policy as their live page. A guest's song is exported like any other, into `plenio/Party-Songs-` in ComfyUI's output folder; a song the admin or a user makes is exported like one made in ComfyUI, into the template's folder. **Waiting to be released** (since 1.4.0, off until the admin switches it on): a song of a user or a guest is exported into a folder of its own, `_waiting/` below its folder, which the library does not read; only its maker (by their session or cookie) and the admins hear it there - the player serves only its record's audio and cover files in that folder -, and releasing it moves its files into its folder (a name taken there gets a number: the files, the stems' folder and the record's list of files renamed alike, the record's fingerprint computed again), while one not released is moved to `_waiting/not released` - the player deletes nothing. *Who made it* (off until the admin chooses) shows a party song's artist - the user's name or *Guest* - while it plays, also to the guests in your network. **A song made again** - a new take of a song of the library, a new song like it or a cover of it: the player reads only that song's release record (at most 32 MB) and its audio file in the record's folder, hands the record to the Song API's `/from-record`, and for a cover of it uploads the song's audio file through the Song API's upload (a new name in ComfyUI's input folder); the library is never written. The party's guests make again only the songs they made themselves. A song made again never takes over the collision rule of the song it comes from, so it gets a new number instead of overwriting it. **The whole studio** for the admin and for whoever comes through *In your network* (on while *In your network* is on; *Settings > Party songs > From the network* switches it off): every field of the template and of Export Release, also while song making is off, without the party's limits. The player checks what it can - a field the template has, a value that is text (at most 4000 characters), a number or yes/no, at most 120 fields, a release folder that is relative and stays below ComfyUI's output folder (no `..`, no absolute path, no drive) - and the Song API checks every value again. It gives no more than *In your network* already does: its second link opens ComfyUI itself. ## Plenio's HTTP routes Every route has one **access class**, declared in the route table and enforced in one place (`plenio/core/access.py`, `plenio/comfy/routes.py`); a test asks every route as another computer would and checks that no answer names a place on this computer (`tests/host/test_route_classes.py`): | Class | Who is answered | Routes | |---|---|---| | `local` | a browser on the computer ComfyUI runs on only | `GET /plenio/system`, `POST /plenio/player/open`, Plenio Setup's `/plenio/setup/*` (the plan, downloads, the token, API tokens, the test song) | | `compute` | whoever reaches ComfyUI: the route reads only its request and writes nothing | `/plenio/score/*`, `/plenio/lyrics/analyze`, `/plenio/sheet/resolve`, `/plenio/brief/fields`, `/plenio/eq/response`, `/plenio/workflow/blocks` | | `data` | whoever reaches ComfyUI: the route reads or writes only inside ComfyUI's own folders, by names checked against them | `/plenio/templates*`, `/plenio/brief/choices`, `/plenio/models/files`, `/plenio/presets/*`, `/plenio/records*`, `/plenio/export/sheet-music*`, `/plenio/asr/notes/*` | | `api` | whoever reaches ComfyUI (the Song API below); another computer only with a token (since 2.0) | `/plenio/api/v1/*`, `/plenio/api/v2/*` | ComfyUI serves Plenio's routes under `/plenio/` (`plenio/comfy/routes.py`). ComfyUI has no login: with `--listen` everyone in the network reaches them. Two answer only a browser on the computer ComfyUI runs on (since 1.4.0) - its connection from a loopback address or the computer's own, and passed on by no proxy (no `Forwarded`, `X-Forwarded-For`, `X-Real-IP` or the player's `X-Plenio-Remote`) - and any other request 403: `GET /plenio/system`, the System Check's report, which names the computer's folders, versions and graphics cards (the System Check node shows it in the workflow), and `POST /plenio/player/open`, which starts a program. An error that is no Plenio error - a bug - is answered without its text, which can name a folder of the computer: ComfyUI's log keeps it (`plenio/core/errors.py`; the Song API alike). They analyse and convert what the editor sends (scores, lyrics, MIDI, the EQ curve) and read the template library and presets. Two write files: `POST /plenio/templates` saves a brief template under a sanitised name in `user/plenio/templates`, and `POST /plenio/export/sheet-music` saves the sheet music PDF of an export - only with the one-time token Export Release created for that file, within 24 hours, only a PDF, only to the name the node reserved. `GET /plenio/export/sheet-music/pending` lists the PDFs still waiting for a page to draw them (their notation and tokens), so a page that opens later can finish them. `GET /plenio/records` lists the release records in the output folder (title, date, file names) and `POST /plenio/records/continue` reads one of them - only a `.plenio.json` inside the output folder - or a record the page sends (read from a `.plenio.json` or from a FLAC by the page itself), to open its song again; both only read. The release record keeps the workflow a run was queued with; secrets are redacted in it as in the prompt (a value a node's key or token input holds is replaced wherever the workflow has it). Since 1.4.0 it also says how the song was made (`made`): when, how long, the graphics card and its memory or the processor alone, the processor's name, its threads and the RAM (`plenio/comfy/host.py`: PyTorch, Windows' registry or Linux's `/proc/cpuinfo`, psutil) - no serial number, user name or path - and how well it came out, measured (`quality`: the stars and every measure, from the song's own sound and record, `plenio/core/quality.py`). A FLAC you pass on carries it too, unless ComfyUI runs with `--disable-metadata`. **The Song API** (since 1.3.0, `/plenio/api/v1`, `plenio/comfy/song_api_v1.py`) makes a song from a template's fields: it reads only the templates that say so, checks every value against the field's type and choices, builds the prompt itself and queues it through ComfyUI's own `POST /prompt` at ComfyUI's own address (the loopback one when it listens on every network), so ComfyUI checks it as any other prompt. `POST /plenio/api/v1/uploads` writes a recording into ComfyUI's input folder - one of the usual audio types, at most 200 MB, under a new name `plenio-api--` - and `DELETE /plenio/api/v1/jobs/{id}` takes a song out of ComfyUI's queue or stops it; nothing else is written. `POST /plenio/api/v1/from-record` reads nothing but the release record in its body - no file of this computer - and answers the request it stands for, with whether a cover's original recording is still in the input folder (a plain name in that folder, never a path). The documents of a job (a new take's title, style, lyrics, score) go into its Song Sheets as manual text, at most 200 000 characters each and without control characters. `GET /plenio/api/v1/jobs/{id}/files/{name}` (since 1.3.1, API 1.1) serves a finished job's files to download: only a name its release record lists, or the record itself - a plain name, in the record's own folder, below ComfyUI's output folder; nothing else of the computer. Several requests with one `Idempotency-Key` at the same time make one job. It can do no more than ComfyUI's own `/prompt` can. Since 2.0 it answers another computer only with a token (`[api] remote`, default `"token"`): tokens are made in Plenio Setup (only on this computer), kept as their SHA-256 in `user/plenio/api/tokens.json`, compared in constant time, never logged or accepted in a URL; a wrong one is answered after a second. `"open"` answers everyone as 1.x did, `"off"` nobody but this computer. A token sees only the runs it made (v1 and v2: lists, answers, files, the queue's ids, the event stream); the released songs of `/plenio/api/v2/songs` are open to every token. The token guards Plenio's routes only: ComfyUI's own `/prompt`, `/history` and `/view` stay as open as ComfyUI is. "This computer" is a connection from a loopback address or the computer's own with no proxy header: a tunnel or gateway that hands requests on from loopback without such a header counts as this computer, and a ComfyUI in a container or behind a reverse proxy may see a program on the same machine as another computer - it then needs a token too (or `PLENIO_API_REMOTE=open` where only you reach it). Like all of ComfyUI, these routes are meant for a ComfyUI that listens on your own machine; if you open ComfyUI to a network, secure it as ComfyUI's own documentation describes. ## Reporting a problem Please report a security problem through GitHub's private vulnerability reporting on this repository (*Security > Report a vulnerability*); if that is not available, open an issue without the details and ask for a private channel.